eric6/QScintilla/QsciScintillaCompat.py

changeset 7998
cd41c844862f
parent 7954
d32319ede131
child 8143
2c730d5fd177
--- a/eric6/QScintilla/QsciScintillaCompat.py	Fri Jan 22 14:14:15 2021 +0100
+++ b/eric6/QScintilla/QsciScintillaCompat.py	Fri Jan 22 16:48:43 2021 +0100
@@ -1534,7 +1534,7 @@
         self.updateUserListSize()
     
     ###########################################################################
-    ## work-arounds for buggy behavior
+    ## work-around for buggy behavior
     ###########################################################################
     
     def updateUserListSize(self):
@@ -1722,6 +1722,21 @@
             """
             self.SendScintilla(QsciScintilla.SCI_SETWRAPSTARTINDENT, indent)
     
+    if "getGlobalCursorPosition" not in QsciScintilla.__dict__:
+        def getGlobalCursorPosition(self):
+            """
+            Public method to determine the point of the cursor.
+            
+            @return point of the cursor
+            @rtype QPoint
+            """
+            pos = self.currentPosition()
+            x = self.SendScintilla(QsciScintilla.SCI_POINTXFROMPOSITION,
+                                   0, pos)
+            y = self.SendScintilla(QsciScintilla.SCI_POINTYFROMPOSITION,
+                                   0, pos)
+            return QPoint(x, y)
+    
 ##    #########################################################################
 ##    ## Methods below have been added to QScintilla starting with version 2.x.
 ##    #########################################################################

eric ide

mercurial