Editor: added some code to cope with potential empty completion text.

Mon, 27 Aug 2018 18:53:41 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 27 Aug 2018 18:53:41 +0200
changeset 6481
9fd81275aaf2
parent 6480
4742bae89e6f
child 6482
15b0a1583cdd

Editor: added some code to cope with potential empty completion text.

QScintilla/Editor.py file | annotate | diff | comparison | revisions
--- a/QScintilla/Editor.py	Sun Aug 26 17:15:17 2018 +0200
+++ b/QScintilla/Editor.py	Mon Aug 27 18:53:41 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