QScintilla/Editor.py

branch
maintenance
changeset 6487
d3ca83d691e7
parent 6455
22a6fc33ab6d
parent 6481
9fd81275aaf2
child 6518
926d65bd23b8
--- a/QScintilla/Editor.py	Thu Aug 02 18:38:40 2018 +0200
+++ b/QScintilla/Editor.py	Sat Sep 01 10:24:02 2018 +0200
@@ -4695,10 +4695,14 @@
         """
         line, col = self.getCursorPosition()
         text = self.text(line)
-        if self.__isStartChar(text[col - 1]):
-            self.__acText = self.getWordLeft(line, col - 1) + text[col - 1]
-        else:
-            self.__acText = self.getWordLeft(line, col)
+        try:
+            if self.__isStartChar(text[col - 1]):
+                self.__acText = self.getWordLeft(line, col - 1) + text[col - 1]
+            else:
+                self.__acText = self.getWordLeft(line, col)
+        except IndexError:
+            self.__acText = ""
+        
         self.__acCompletions.clear()
         self.__acCompletionsFinished = 0
         

eric ide

mercurial