WorkspaceCompletionSupport.st
changeset 6705 efea30a3e8e0
parent 6688 e2c2e797ab21
--- a/WorkspaceCompletionSupport.st	Sun Sep 15 18:29:12 2019 +0200
+++ b/WorkspaceCompletionSupport.st	Sun Sep 15 18:55:37 2019 +0200
@@ -112,6 +112,15 @@
         ^ self
     ].
 
+    completionView isNil ifTrue:[
+        self openCompletionView:nil.
+    ].
+
+    "/ if the completionView has been closed in the meantime
+    (v := completionView) isNil ifTrue: [
+        ^ self
+    ].
+
     implementations := implementationsArg.
     actions := actionsArg.
 
@@ -156,7 +165,7 @@
         ].    
     ].
 
-    "/ append snipplet, if any (can be easily reached via CRSR-up)
+    "/ append snippet, if any (can be easily reached via CRSR-up)
     suggestionOffsetDueToSnippets := 0.
     indexOfSnippet := nil.
     UserPreferences current appendAbbreviationsToCompletionSuggestions ifTrue:[
@@ -191,15 +200,16 @@
         self closeCompletionView.
         ^ self
     ].
-    (v := completionView) isNil ifTrue: [
+    (v == completionView) ifFalse: [
+        "/ the completionView has been closed in the meantime
         ^ self
     ].
 
     v sensor
-        pushUserEvent:#value
-        for:[
+        pushAction:[
             |top idx preselectIdx performCompletion|
 
+            "/ if the completionView has not been closed in the meantime
             (v == completionView) ifTrue: [
                 top := v topView.
                 autoSelectArg ifTrue:[
@@ -294,14 +304,15 @@
                         "/ very disturbing!!
                         v selection:preselectIdx.
                     ].
-                    v extent:completionView preferredExtentForContents.
+                    "/ v extent:completionView preferredExtentForContents.
                     v action:performCompletion.
 
                     (top ~~ v) ifTrue:[
-                        top resizeToFit.
-                        top bottom > v device usableHeight ifTrue:[
-                            top origin:((top origin x) @ (v device usableHeight - v height)).
-                        ].
+                        self adjustSizeOfCompletionView:top.
+"/                        top resizeToFit.
+"/                        top bottom > v device usableHeight ifTrue:[
+"/                            top origin:((top origin x) @ (v device usableHeight - v height)).
+"/                        ].
                         top raise.
                     ]
                 ]