--- a/SmallSense__CompletionController.st Sat Jun 14 00:35:03 2014 +0100
+++ b/SmallSense__CompletionController.st Tue Jun 17 09:06:21 2014 +0100
@@ -93,13 +93,13 @@
^ true
].
key isCharacter ifTrue:[
- self updateSelection.
+ self updateSelectionAfterKeyPress: key.
].
].
^ super handleKeyPress:key x:x y:y
"Created: / 27-09-2013 / 15:38:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 31-03-2014 / 22:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 17-06-2014 / 07:24:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
handleKeyPressTab
@@ -270,10 +270,24 @@
!
updateSelection
- "Updates selection in completion view based on
- currently typed partial text. Return true if
- the complection window should be closed or false
- if it shall be kept open."
+ "Updates selection in completion view based on currently typed partial
+ text. Return true if the complection window should be closed or false
+ if it shall be kept open. "
+
+ ^ self updateSelectionAfterKeyPress: nil
+
+ "Created: / 27-09-2013 / 16:16:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 17-06-2014 / 07:24:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+updateSelectionAfterKeyPress: keyOrNil
+ "Updates selection in completion view based on currently typed partial
+ text. Return true if the complection window should be closed or false
+ if it shall be kept open.
+
+ If `keyOrNil` is not nil, then it's a key press that triggered the update
+ which HAS NOT YET been processed by a `editView`.
+ "
| list prefix matcher1 matches1 matcher2 matches2 |
@@ -281,6 +295,9 @@
matcher1 := CompletionEngine exactMatcher.
matcher2 := CompletionEngine inexactMatcher.
prefix := self prefixAlreadyWritten.
+ keyOrNil isCharacter ifTrue:[
+ prefix := prefix , keyOrNil
+ ].
matches1 := list select:[:po | matcher1 value: prefix value: po stringToComplete ].
matches1 notEmptyOrNil ifTrue:[
@@ -322,8 +339,7 @@
].
^ false.
- "Created: / 27-09-2013 / 16:16:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 18-05-2014 / 13:57:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 17-06-2014 / 07:19:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!CompletionController methodsFor:'private-API'!