class: DoWhatIMeanSupport
authorClaus Gittinger <cg@exept.de>
Tue, 08 Oct 2013 17:20:10 +0200
changeset 4431 a2842ed29589
parent 4430 fdec7df88fd1
child 4432 4b132f377d09
class: DoWhatIMeanSupport changed: #codeCompletionForLiteralSymbol:element:considerAll:into:
DoWhatIMeanSupport.st
--- 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 $'
 ! !