eric6/QScintilla/QsciScintillaCompat.py

changeset 7746
12d5e1e6abd1
parent 7639
422fd05e9c91
child 7781
607a6098cb44
equal deleted inserted replaced
7745:43888e12e481 7746:12d5e1e6abd1
45 ArrowFoldStyle = QsciScintilla.BoxedTreeFoldStyle + 1 45 ArrowFoldStyle = QsciScintilla.BoxedTreeFoldStyle + 1
46 ArrowTreeFoldStyle = ArrowFoldStyle + 1 46 ArrowTreeFoldStyle = ArrowFoldStyle + 1
47 47
48 UserSeparator = '\x04' 48 UserSeparator = '\x04'
49 49
50 if QSCINTILLA_VERSION() < 0x020A00: 50 IndicatorStyleMax = QsciScintilla.INDIC_GRADIENTCENTRE
51 IndicatorStyleMax = QsciScintilla.INDIC_TEXTFORE
52 elif QSCINTILLA_VERSION() < 0x020B00:
53 IndicatorStyleMax = QsciScintilla.INDIC_POINTCHARACTER
54 else:
55 IndicatorStyleMax = QsciScintilla.INDIC_GRADIENTCENTRE
56 51
57 def __init__(self, parent=None): 52 def __init__(self, parent=None):
58 """ 53 """
59 Constructor 54 Constructor
60 55
1643 1638
1644 ########################################################################### 1639 ###########################################################################
1645 ## methods to implement workarounds for broken things 1640 ## methods to implement workarounds for broken things
1646 ########################################################################### 1641 ###########################################################################
1647 1642
1648 if QSCINTILLA_VERSION() == 0x020B00:
1649 def insert(self, txt):
1650 """
1651 Public method to insert text at the cursor position.
1652
1653 @param txt text to be inserted
1654 @type str
1655 """
1656 line, col = self.getCursorPosition()
1657 self.insertAt(txt, line, col)
1658
1659 def positionFromLineIndex(self, line, index): 1643 def positionFromLineIndex(self, line, index):
1660 """ 1644 """
1661 Public method to convert line and index to an absolute position. 1645 Public method to convert line and index to an absolute position.
1662 1646
1663 @param line line number (integer) 1647 @param line line number (integer)
1708 """ 1692 """
1709 for line in folds: 1693 for line in folds:
1710 self.foldLine(line) 1694 self.foldLine(line)
1711 1695
1712 ######################################################################### 1696 #########################################################################
1713 ## Method below implements a compatibility variant for the findFirst()
1714 ## extended with version 2.11.
1715 #########################################################################
1716
1717 def findFirst(self, expression, regexp, caseSensitive, word, wrap,
1718 forward=True, line=-1, index=-1, show=True, posix=False,
1719 cxx11=False):
1720 """
1721 Public method to search in the current editor text.
1722
1723 @param expression search expression
1724 @type str
1725 @param regexp flag indicating a regular expression
1726 @type bool
1727 @param caseSensitive flag indicating a case sensitive search
1728 @type bool
1729 @param word flag indicating a word only search
1730 @type bool
1731 @param wrap flag indicating to warp around
1732 @type bool
1733 @param forward flag indicating the search direction
1734 @type bool
1735 @param line line to start the search on
1736 @type int
1737 @param index index to start the search on
1738 @type int
1739 @param show flag indicating to set the selection to the found
1740 expression
1741 @type bool
1742 @param posix flag indicating the POSIX regular expression search mode
1743 @type bool
1744 @param cxx11 flag indicating the CXX11 regular expression search mode
1745 @type bool
1746 @return flag indicating a successful search
1747 @rtype bool
1748 """
1749 if QSCINTILLA_VERSION() >= 0x020B00:
1750 return super(QsciScintillaCompat, self).findFirst(
1751 expression, regexp, caseSensitive, word, wrap,
1752 forward=forward, line=line, index=index, show=show,
1753 posix=posix, cxx11=cxx11)
1754 else:
1755 return super(QsciScintillaCompat, self).findFirst(
1756 expression, regexp, caseSensitive, word, wrap,
1757 forward=forward, line=line, index=index, show=show,
1758 posix=posix)
1759
1760 #########################################################################
1761 ## Methods below are missing from QScintilla. 1697 ## Methods below are missing from QScintilla.
1762 ######################################################################### 1698 #########################################################################
1763 1699
1764 if "setWrapStartIndent" not in QsciScintilla.__dict__: 1700 if "setWrapStartIndent" not in QsciScintilla.__dict__:
1765 def setWrapStartIndent(self, indent): 1701 def setWrapStartIndent(self, indent):

eric ide

mercurial