search backward index bug (when cursor is beyond end of text)
authorClaus Gittinger <cg@exept.de>
Tue, 03 Jun 2003 11:20:39 +0200
changeset 2771 97cea7d919e5
parent 2770 6b49ba35c070
child 2772 4e04a3bf399f
search backward index bug (when cursor is beyond end of text)
ListView.st
--- a/ListView.st	Fri May 30 10:49:25 2003 +0200
+++ b/ListView.st	Tue Jun 03 11:20:39 2003 +0200
@@ -4076,10 +4076,16 @@
             ] ifFalse:[
                 firstChar2 := firstChar1
             ].
-            col > (list at:startLine) size ifTrue:[
+
+            line1 := startLine.
+            line1 > list size ifTrue:[
+                line1 := list size.
                 col := -999
+            ] ifFalse:[
+                col > (list at:line1) size ifTrue:[
+                    col := -999
+                ]
             ].
-            line1 := startLine.
             line1 to:1 by:-1 do:[:lnr |
                 lineString := list at:lnr.
                 lineString notNil ifTrue:[
@@ -4447,5 +4453,5 @@
 !ListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.283 2003-05-19 08:53:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.284 2003-06-03 09:20:39 cg Exp $'
 ! !