Bugfix: do not cache #completeIfUnambiguous, always ask preferences.
Otherwise testing is not possible as settings are updated after a test view is created.
--- a/SmallSense__CompletionController.st Sat May 02 22:01:31 2015 +0200
+++ b/SmallSense__CompletionController.st Sat May 02 22:10:30 2015 +0200
@@ -21,7 +21,7 @@
"{ NameSpace: SmallSense }"
EditTextViewCompletionSupport subclass:#CompletionController
- instanceVariableNames:'support seqno completeIfUnambiguous'
+ instanceVariableNames:'support seqno'
classVariableNames:''
poolDictionaries:''
category:'SmallSense-Core'
@@ -248,11 +248,10 @@
"/ please change as required (and remove this comment)
"/ support := nil.
seqno := 0.
- completeIfUnambiguous := UserPreferences current smallSenseCompleteIfUnambiguous.
"/ super initialize. -- commented since inherited method does nothing
- "Modified: / 18-01-2014 / 23:10:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-05-2015 / 22:07:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!CompletionController methodsFor:'private'!
@@ -357,7 +356,7 @@
| selection completeElectric |
selection := matches1 anElement.
- completeElectric := completeIfUnambiguous and:[ support electricInsertSuppressed not ].
+ completeElectric := (UserPreferences current smallSenseCompleteIfUnambiguous) and:[ support electricInsertSuppressed not ].
(completeElectric and: [(editView sensor hasKeyEventFor:editView) not]) ifTrue:[
self complete: selection afterKeyPress: keyOrNil.
^ true
@@ -397,7 +396,7 @@
^ false.
"Created: / 17-06-2014 / 07:19:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 03-03-2015 / 17:15:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-05-2015 / 22:07:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!CompletionController methodsFor:'private-API'!