#REFACTORING by cg
class: SmallSense::CompletionController
changed: #handleKeyPress:x:y:
--- a/SmallSense__CompletionController.st Wed Aug 16 20:25:49 2017 +0200
+++ b/SmallSense__CompletionController.st Thu Aug 24 22:44:19 2017 +0200
@@ -102,46 +102,49 @@
handleKeyPress:key x:x y:y
key == #Control_L ifTrue:[
- completionView notNil ifTrue:[
- ^ false.
- ].
+ completionView notNil ifTrue:[
+ ^ false.
+ ].
].
key == #CodeCompletion ifTrue: [
- autoSelect := true.
- self startCompletionProcess.
- ^ true
+ autoSelect := true.
+ self startCompletionProcess.
+ ^ true
].
+ editView cursorCol <= 1 ifTrue:[^ false].
+
(key == #BackSpace or:[key == #BasicBackspace]) ifTrue:[
- | c |
+ | c |
- c := editView characterBeforeCursor.
- (c notNil and:[c isAlphaNumeric]) ifTrue:[
- ^ false
- ].
+ c := editView characterBeforeCursor.
+ (c notNil and:[c isAlphaNumeric]) ifTrue:[
+ ^ false
+ ].
].
completionView notNil ifTrue:[
- (key == #Return and:[completionView hasSelection]) ifTrue:[
- self complete.
- ^ true.
- ].
- key == #Tab ifTrue:[
- self handleKeyPressTab.
- ^ true
- ].
- key isCharacter ifTrue:[
- (self updateSelectionAfterKeyPress: key) ifTrue:[
- ^ true
- ].
- ].
+ (key == #Return and:[completionView hasSelection]) ifTrue:[
+ self complete.
+ ^ true.
+ ].
+ key == #Tab ifTrue:[
+ self handleKeyPressTab.
+ ^ true
+ ].
+ key isCharacter ifTrue:[
+ (self updateSelectionAfterKeyPress: key) ifTrue:[
+ ^ true
+ ].
+ ].
].
^ super handleKeyPress:key x:x y:y
"Created: / 27-09-2013 / 15:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 18-06-2014 / 10:17:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 24-08-2017 / 21:33:39 / cg"
!
handleKeyPressTab