Fix in CompletionController>>prefixAlreadyWritten - let the first PO answer the prefix written...
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 24 Jun 2014 11:42:58 +0100
changeset 245 172822a63cff
parent 244 bb15db399de5
child 247 5b0a13159028
child 350 762fdff80221
Fix in CompletionController>>prefixAlreadyWritten - let the first PO answer the prefix written... ...but only if all PO's are of the same class. This is hack rather than solution, the completer should store the prefix in a context.
SmallSense__CompletionController.st
--- a/SmallSense__CompletionController.st	Tue Jun 24 11:16:51 2014 +0100
+++ b/SmallSense__CompletionController.st	Tue Jun 24 11:42:58 2014 +0100
@@ -239,13 +239,14 @@
         list notEmptyOrNil ifTrue:[ 
             first := list first.
             (completionView list allSatisfy:[:e | e class == first class ]) ifTrue:[ 
-                first stringAlreadyWritten 
+                ^ first stringAlreadyWritten 
             ]
         ]
     ].
     ^ support wordBeforeCursor string .
 
     "Created: / 18-05-2014 / 13:55:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-06-2014 / 11:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 stopCompletionProcess
@@ -300,7 +301,6 @@
     keyOrNil isCharacter ifTrue:[ 
         prefix := prefix , keyOrNil
     ].
-
     matches1 := list select:[:po | matcher1 value: prefix value: po stringToComplete ].
     matches1 notEmptyOrNil ifTrue:[
         matches1 size == 1 ifTrue:[
@@ -342,6 +342,7 @@
     ^ false.
 
     "Created: / 17-06-2014 / 07:19:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-06-2014 / 11:41:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CompletionController methodsFor:'private-API'!