Workspace.st
changeset 3720 bc5f7425c6c1
parent 3717 d3c323d0fa98
child 3726 a95a68928876
--- a/Workspace.st	Tue Oct 07 14:23:16 2008 +0200
+++ b/Workspace.st	Sun Oct 12 14:28:54 2008 +0200
@@ -1068,9 +1068,10 @@
 
     maxKeyLen := (self class sniplets keys collect:[:k | k size]) max.
     (1 to:maxKeyLen) do:[:l |
-        |stringBeforeCursor lCharactersBeforeCursor expandedString|
+        |line stringBeforeCursor lCharactersBeforeCursor expandedString|
 
-        stringBeforeCursor := ((self at:cursorLine) ? '') string copyTo:cursorCol-1.
+        line := (self at:cursorLine) ? ''.
+        stringBeforeCursor := line string copyTo:((cursorCol-1) min:line size).
         stringBeforeCursor size < l ifTrue:[ ^ nil].
 
         lCharactersBeforeCursor := stringBeforeCursor last:l.
@@ -1604,5 +1605,5 @@
 !Workspace class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.187 2008-10-07 10:37:12 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.188 2008-10-12 12:28:54 cg Exp $'
 ! !