1620 return string.encode("utf-8") |
1620 return string.encode("utf-8") |
1621 else: |
1621 else: |
1622 return string.encode("latin-1") |
1622 return string.encode("latin-1") |
1623 |
1623 |
1624 ########################################################################### |
1624 ########################################################################### |
|
1625 ## methods to implement workarounds for broken things |
|
1626 ########################################################################### |
|
1627 |
|
1628 def insert(self, txt): |
|
1629 """ |
|
1630 Public method to insert text at the cursor position. |
|
1631 |
|
1632 @param txt text to be inserted |
|
1633 @type str |
|
1634 """ |
|
1635 line, col = self.getCursorPosition() |
|
1636 self.insertAt(txt, line, col) |
|
1637 |
|
1638 ########################################################################### |
1625 ## methods below have been added to QScintilla starting with version 2.5 |
1639 ## methods below have been added to QScintilla starting with version 2.5 |
1626 ########################################################################### |
1640 ########################################################################### |
1627 |
1641 |
1628 if "positionFromLineIndex" not in QsciScintilla.__dict__: |
1642 if "positionFromLineIndex" not in QsciScintilla.__dict__: |
1629 def positionFromLineIndex(self, line, index): |
1643 def positionFromLineIndex(self, line, index): |