class: Workspace
authorClaus Gittinger <cg@exept.de>
Thu, 05 Sep 2013 02:19:43 +0200
changeset 4741 289a3dde9ab8
parent 4740 0399aad4f124
child 4742 a00cb40ee392
class: Workspace
Workspace.st
--- a/Workspace.st	Wed Sep 04 23:45:24 2013 +0200
+++ b/Workspace.st	Thu Sep 05 02:19:43 2013 +0200
@@ -2198,8 +2198,10 @@
 handleKeyPress:key x:x y:y
     "return true, if I have eaten this keypress"
 
-    |ch|
-
+    |ch completeImmediate eatCursorLeftOrRight|
+
+    completeImmediate := UserPreferences current immediateCodeCompletion.
+    
     "/ open on CTRL- or TAB-key?
     (completionView isNil or:[completionView realized not]) ifTrue:[
         editView hasSelection ifFalse:[
@@ -2227,10 +2229,13 @@
     key isCharacter ifFalse:[
         "/ forward to menu
         completionView notNil ifTrue:[
+            eatCursorLeftOrRight := completeImmediate not
+                                    or:[ editView sensor shiftDown 
+                                    or:[ editView sensor ctrlDown ]].
             (key == #CursorDown 
                 or:[ (key == #CursorUp)
-                or:[ (key == #CursorLeft)
-                or:[ (key == #CursorRight)
+                or:[ ((key == #CursorLeft) and:[eatCursorLeftOrRight])
+                or:[ ((key == #CursorRight) and:[eatCursorLeftOrRight])
                 or:[ ((key == #Return) and:[ completionView hasSelection ])
             ]]]]) ifTrue:[
                 "/ only with shift - normal user typing should not interfere with completion
@@ -2528,10 +2533,10 @@
 !Workspace class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.293 2013-09-04 17:22:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.294 2013-09-05 00:19:43 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.293 2013-09-04 17:22:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.294 2013-09-05 00:19:43 cg Exp $'
 ! !