Fixed cancellation of auto-completion lists.

Fri, 22 Dec 2017 16:36:02 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 22 Dec 2017 16:36:02 +0100
changeset 6033
967b3e3e5b4d
parent 6032
5f80be18bcd7
child 6034
4f88f70d2cd4

Fixed cancellation of auto-completion lists.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric6.QScintilla.Editor.html file | annotate | diff | comparison | revisions
QScintilla/Editor.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Fri Dec 22 16:21:40 2017 +0100
+++ b/Documentation/Help/source.qhp	Fri Dec 22 16:36:02 2017 +0100
@@ -5145,6 +5145,7 @@
       <keyword name="Editor.__adjustedCallTipPosition" id="Editor.__adjustedCallTipPosition" ref="eric6.QScintilla.Editor.html#Editor.__adjustedCallTipPosition" />
       <keyword name="Editor.__applyTemplate" id="Editor.__applyTemplate" ref="eric6.QScintilla.Editor.html#Editor.__applyTemplate" />
       <keyword name="Editor.__autoComplete" id="Editor.__autoComplete" ref="eric6.QScintilla.Editor.html#Editor.__autoComplete" />
+      <keyword name="Editor.__autocompletionCancelled" id="Editor.__autocompletionCancelled" ref="eric6.QScintilla.Editor.html#Editor.__autocompletionCancelled" />
       <keyword name="Editor.__autosaveEnable" id="Editor.__autosaveEnable" ref="eric6.QScintilla.Editor.html#Editor.__autosaveEnable" />
       <keyword name="Editor.__bindCompleter" id="Editor.__bindCompleter" ref="eric6.QScintilla.Editor.html#Editor.__bindCompleter" />
       <keyword name="Editor.__bindLexer" id="Editor.__bindLexer" ref="eric6.QScintilla.Editor.html#Editor.__bindLexer" />
--- a/Documentation/Source/eric6.QScintilla.Editor.html	Fri Dec 22 16:21:40 2017 +0100
+++ b/Documentation/Source/eric6.QScintilla.Editor.html	Fri Dec 22 16:36:02 2017 +0100
@@ -183,6 +183,9 @@
 <td><a href="#Editor.__autoComplete">__autoComplete</a></td>
 <td>Private method to start auto-completion via plug-ins.</td>
 </tr><tr>
+<td><a href="#Editor.__autocompletionCancelled">__autocompletionCancelled</a></td>
+<td>Private slot to handle the cancellation of an auto-completion list.</td>
+</tr><tr>
 <td><a href="#Editor.__autosaveEnable">__autosaveEnable</a></td>
 <td>Private slot handling the autosave enable context menu action.</td>
 </tr><tr>
@@ -1350,7 +1353,12 @@
 <dd>
 flag indicating to complete a context
 </dd>
-</dl><a NAME="Editor.__autosaveEnable" ID="Editor.__autosaveEnable"></a>
+</dl><a NAME="Editor.__autocompletionCancelled" ID="Editor.__autocompletionCancelled"></a>
+<h4>Editor.__autocompletionCancelled</h4>
+<b>__autocompletionCancelled</b>(<i></i>)
+<p>
+        Private slot to handle the cancellation of an auto-completion list.
+</p><a NAME="Editor.__autosaveEnable" ID="Editor.__autosaveEnable"></a>
 <h4>Editor.__autosaveEnable</h4>
 <b>__autosaveEnable</b>(<i></i>)
 <p>
--- a/QScintilla/Editor.py	Fri Dec 22 16:21:40 2017 +0100
+++ b/QScintilla/Editor.py	Fri Dec 22 16:36:02 2017 +0100
@@ -4576,6 +4576,14 @@
         
         return False
     
+    def __autocompletionCancelled(self):
+        """
+        Private slot to handle the cancellation of an auto-completion list.
+        """
+        self.__acWatchdog.stop()
+        
+        self.__acText = ""
+    
     #################################################################
     ## auto-completion hook interfaces
     #################################################################
@@ -4612,6 +4620,7 @@
             if self.autoCompletionThreshold() > 0:
                 self.setAutoCompletionThreshold(0)
             self.SCN_CHARADDED.connect(self.__charAdded)
+            self.SCN_AUTOCCANCELLED.connect(self.__autocompletionCancelled)
         
         if async:
             self.__completionListAsyncHookFunctions[key] = func
@@ -4634,6 +4643,7 @@
         if not self.__completionListHookFunctions and \
            not self.__completionListAsyncHookFunctions:
             self.SCN_CHARADDED.disconnect(self.__charAdded)
+            self.SCN_AUTOCCANCELLED.disconnect(self.__autocompletionCancelled)
             if self.autoCompletionThreshold() == 0:
                 self.setAutoCompletionThreshold(
                     Preferences.getEditor("AutoCompletionThreshold"))

eric ide

mercurial