CTRL-a (move to begin of line)
authorClaus Gittinger <cg@exept.de>
Tue, 14 Sep 2004 11:55:41 +0200
changeset 3020 68a2dfad4e5e
parent 3019 6cfaf60fd8ea
child 3021 31557e9be5ec
CTRL-a (move to begin of line)
EditTextView.st
--- a/EditTextView.st	Mon Sep 13 18:03:43 2004 +0200
+++ b/EditTextView.st	Tue Sep 14 11:55:41 2004 +0200
@@ -1312,9 +1312,19 @@
 !
 
 cursorToBeginOfLine
-    "move cursor to start of current line"
-
-    self cursorCol:1
+    "move cursor to the start of the current line"
+
+    |textStart l|
+
+    l := self listAt:cursorLine.
+    textStart := l isNil ifTrue:[1] ifFalse:[l indexOfNonSeparator].
+    cursorCol > textStart ifTrue:[
+        self cursorCol:textStart
+    ] ifFalse:[
+        self cursorCol:1
+    ]
+
+    "Created: / 8.8.2004 / 18:51:21 / janfrog"
 !
 
 cursorToBottom
@@ -5858,5 +5868,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.355 2004-06-22 07:41:04 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.356 2004-09-14 09:55:41 cg Exp $'
 ! !