EditTextViewCompletionSupport.st
changeset 6315 1362b6366e09
parent 6197 3a3a1cabb663
child 6370 b5cd4fd52b3c
--- a/EditTextViewCompletionSupport.st	Fri Apr 27 17:16:22 2018 +0200
+++ b/EditTextViewCompletionSupport.st	Wed May 09 13:11:29 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'stx:libwidg' }"
 
 "{ NameSpace: Smalltalk }"
@@ -95,9 +97,13 @@
                 ].
                 ((key == #Tab) and:[editView sensor shiftDown not]) ifTrue:[
                     UserPreferences current codeCompletionOnTabKey ifTrue:[
-                        autoSelect := true.
-                        self updateCompletionList.
-                        ^ true
+                        "/ only if the character after the cursor is a separator!!
+                        "/ otherwise, we cannot insert tabs 
+                        (ch := editView characterAfterCursor isNil or:[ch isSeparator]) ifTrue:[
+                            autoSelect := true.
+                            self updateCompletionList.
+                            ^ true
+                        ].
                     ].
                 ]
             ].
@@ -367,7 +373,6 @@
     "Created: / 26-09-2013 / 17:07:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-
 !EditTextViewCompletionSupport class methodsFor:'documentation'!
 
 version