EditTextViewCompletionSupport.st
changeset 6650 340342c01ce4
parent 6632 8670224f9fd5
child 6657 90673a5bc399
--- a/EditTextViewCompletionSupport.st	Thu Jul 25 13:01:54 2019 +0200
+++ b/EditTextViewCompletionSupport.st	Mon Jul 29 09:21:38 2019 +0200
@@ -87,7 +87,8 @@
     "/ open on CTRL- or TAB-key?
     (completionView notNil and:[completionView realized]) ifFalse:[
         editView hasSelection ifFalse:[
-            ((ch := editView characterBeforeCursor) notNil "/ i.e. not at begin of line
+            ch := editView characterBeforeCursor.
+            (ch notNil "/ i.e. not at begin of line
             and:[ ch isLetterOrDigitOrUnderline ]) ifTrue:[
                 (key == #Control_L or:[ key == #Ctrl or:[ key == #Control_R or:[ key == #Control]]]) ifTrue:[
                     UserPreferences current codeCompletionOnControlKey ifTrue:[
@@ -169,13 +170,18 @@
 !
 
 postKeyPress:key
-    |doComplete|
+    |doComplete ch|
 
     UserPreferences current immediateCodeCompletion ifFalse:[
         "/ only update, if already open
         completionView isNil ifTrue:[^ self].
     ].
 
+    "/ (completionView notNil and:[completionView realized]) ifTrue:[^ self].
+    editView hasSelection ifTrue:[^ self].
+    ch := editView characterBeforeCursor.
+    (ch notNil and:[ch isLetterOrDigitOrUnderline]) ifFalse:[^ self].
+
     (key == #BackSpace or:[key == #BasicBackspace]) ifTrue:[
         autoSelect := false.
         self updateCompletionList.