added: #selectFromCharacterPosition:
authorClaus Gittinger <cg@exept.de>
Thu, 18 Mar 2010 15:56:16 +0100
changeset 4140 435dc4fec8fb
parent 4139 ed1fc3ee4a4b
child 4141 06c97cc2bf6d
added: #selectFromCharacterPosition:
TextView.st
--- a/TextView.st	Thu Mar 18 12:33:18 2010 +0100
+++ b/TextView.st	Thu Mar 18 15:56:16 2010 +0100
@@ -4066,6 +4066,19 @@
     self selectFromLine:1 col:1 toLine:(list size + 1) col:0
 !
 
+selectFromCharacterPosition:pos1
+    "compute line/col from the character position and select the text up to the end"
+
+    |line1 col1 line2 col2|
+
+    line1 := self lineOfCharacterPosition:pos1.
+    col1 := pos1 - (self characterPositionOfLine:line1 col:1) + 1.
+
+    line2 := (list size + 1).
+    col2 := 0.
+    self selectFromLine:line1 col:col1 toLine:line2 col:col2
+!
+
 selectFromCharacterPosition:pos1 to:pos2
     "compute line/col from character positions and select the text"
 
@@ -4338,11 +4351,11 @@
 !TextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.315 2009-12-01 11:46:14 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.316 2010-03-18 14:56:16 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.315 2009-12-01 11:46:14 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.316 2010-03-18 14:56:16 cg Exp $'
 ! !
 
 TextView initialize!