Fixed an issue in QsciScintillaCompat occurring with QScintilla 2.8 and newer.

Sat, 15 Mar 2014 19:01:43 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 15 Mar 2014 19:01:43 +0100
changeset 3378
b88e7fd6c009
parent 3377
2644be0a8f1a
child 3380
8c38eb4be178

Fixed an issue in QsciScintillaCompat occurring with QScintilla 2.8 and newer.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/QScintilla/QsciScintillaCompat.py	Sat Mar 15 17:35:04 2014 +0100
+++ b/QScintilla/QsciScintillaCompat.py	Sat Mar 15 19:01:43 2014 +0100
@@ -1336,6 +1336,18 @@
             
             return pos
     
+    elif QSCINTILLA_VERSION() >= 0x020800:
+        def positionFromLineIndex(self, line, index):
+            """
+            Public method to convert line and index to an absolute position.
+            
+            @param line line number (integer)
+            @param index index number (integer)
+            @return absolute position in the editor (integer)
+            """
+            pos = self.SendScintilla(QsciScintilla.SCI_POSITIONFROMLINE, line)
+            return pos + index
+    
     if "lineIndexFromPosition" not in QsciScintilla.__dict__:
         def lineIndexFromPosition(self, pos):
             """
@@ -1364,6 +1376,19 @@
             
             return lin, indx
     
+    elif QSCINTILLA_VERSION() >= 0x020800:
+        def lineIndexFromPosition(self, pos):
+            """
+            Public method to convert an absolute position to line and index.
+            
+            @param pos absolute position in the editor (integer)
+            @return tuple of line number (integer) and index number (integer)
+            """
+            lin = self.SendScintilla(QsciScintilla.SCI_LINEFROMPOSITION, pos)
+            linpos = self.SendScintilla(
+                QsciScintilla.SCI_POSITIONFROMLINE, lin)
+            return lin, pos - linpos
+    
     if "contractedFolds" not in QsciScintilla.__dict__:
         def contractedFolds(self):
             """

eric ide

mercurial