class: DoWhatIMeanSupport
changed: #codeCompletionForLiteralSymbol:element:considerAll:into:
--- a/DoWhatIMeanSupport.st Tue Oct 08 15:37:25 2013 +0200
+++ b/DoWhatIMeanSupport.st Tue Oct 08 17:20:10 2013 +0200
@@ -1890,28 +1890,29 @@
|chosen oldSym oldLen newLen|
chosen := possibleCompletions at:chosenIndex.
-
- (codeView characterAtCharacterPosition:start) == $# ifTrue:[
- start := start + 1.
- ].
- (codeView characterAtCharacterPosition:start) == $' ifTrue:[
- start := start + 1.
- ].
-
- oldSym := (codeView textFromCharacterPosition:start to:stop) asString string withoutSeparators.
-
- codeView
- undoableDo:[
- codeView replaceFromCharacterPosition:start to:stop with:chosen
- ]
- info:'Completion'.
-
- (chosen startsWith:oldSym) ifTrue:[
- oldLen := stop - start + 1.
- newLen := chosen size.
- codeView selectFromCharacterPosition:start+oldLen to:start+newLen-1.
- codeView dontReplaceSelectionOnInput
- ].
+ chosen notNil ifTrue:[
+ (codeView characterAtCharacterPosition:start) == $# ifTrue:[
+ start := start + 1.
+ ].
+ (codeView characterAtCharacterPosition:start) == $' ifTrue:[
+ start := start + 1.
+ ].
+
+ oldSym := (codeView textFromCharacterPosition:start to:stop) asString string withoutSeparators.
+
+ codeView
+ undoableDo:[
+ codeView replaceFromCharacterPosition:start to:stop with:chosen
+ ]
+ info:'Completion'.
+
+ (chosen startsWith:oldSym) ifTrue:[
+ oldLen := stop - start + 1.
+ newLen := chosen size.
+ codeView selectFromCharacterPosition:start+oldLen to:start+newLen-1.
+ codeView dontReplaceSelectionOnInput
+ ].
+ ]
].
actionBlock value:possibleCompletions value:editAction value:'symbol'.
@@ -4528,10 +4529,10 @@
!DoWhatIMeanSupport class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.179 2013-10-08 13:37:25 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.180 2013-10-08 15:20:10 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.179 2013-10-08 13:37:25 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.180 2013-10-08 15:20:10 cg Exp $'
! !