QScintilla/Editor.py

changeset 5916
26a37798aa75
parent 5913
7ab2293917f8
child 5919
d0de2b378b24
--- a/QScintilla/Editor.py	Thu Oct 19 19:39:59 2017 +0200
+++ b/QScintilla/Editor.py	Fri Oct 20 22:56:57 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