Merged with changes from Tobias.

Sat, 21 Oct 2017 15:11:21 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 21 Oct 2017 15:11:21 +0200
changeset 5917
ba1312abe858
parent 5915
4bdac859df60 (current diff)
parent 5916
26a37798aa75 (diff)
child 5918
d89cd224dd1b

Merged with changes from Tobias.

--- a/QScintilla/Editor.py	Sat Oct 21 14:43:51 2017 +0200
+++ b/QScintilla/Editor.py	Sat Oct 21 15:11:21 2017 +0200
@@ -4646,21 +4646,23 @@
         
         if self.__completionListHookFunctions or \
            self.__completionListAsyncHookFunctions:
-            if Preferences.getEditor("AutoCompletionTimeout"):
+            if auto and Preferences.getEditor("AutoCompletionTimeout"):
                 self.__acTimer.stop()
                 self.__acContext = context
                 self.__acTimer.start()
             else:
-                self.__autoComplete(context)
+                self.__autoComplete(auto, context)
         elif not auto:
             self.autoCompleteQScintilla()
         elif self.autoCompletionSource() != QsciScintilla.AcsNone:
             self.autoCompleteQScintilla()
     
-    def __autoComplete(self, context=None):
+    def __autoComplete(self, auto=True, context=None):
         """
         Private method to start auto-completion via plug-ins.
         
+        @keyparam auto flag indicating a call from the __charAdded method
+            (boolean)
         @keyparam context flag indicating to complete a context
         @type bool or None
         """
@@ -4672,6 +4674,10 @@
             self.__acText = self.getWordLeft(line, col)
         self.__acCompletions.clear()
         
+        # Suppress empty completions
+        if auto and self.__acText == '':
+            return
+        
         completions = self.__acCache.get(self.__acText)
         if completions is not None:
             # show list with cached entries

eric ide

mercurial