#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Tue, 05 Sep 2017 19:51:48 +0200
changeset 6207 7a5c2914e422
parent 6206 f7a386aee648
child 6208 15a6a6d337de
#BUGFIX by cg class: EditTextView comment/format in: #setCursorCol: changed: #basicDeleteCharsAtLine:fromCol:toCol: #cursorLeft #selectFromBeginOfLine #selectToEndOfLine cursor left should not remove trailing whitespace (think of backspacing after typing)
EditTextView.st
--- a/EditTextView.st	Fri Sep 01 14:43:16 2017 +0200
+++ b/EditTextView.st	Tue Sep 05 19:51:48 2017 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
@@ -2045,8 +2047,13 @@
 cursorLeft
     "move cursor to left"
 
+    |wasOn|
+
     (cursorCol ~~ 1) ifTrue:[
-        self cursorCol:(cursorCol - 1)
+        wasOn := self hideCursor.
+        self setValidatedCursorCol:(cursorCol - 1).
+        self makeCursorVisibleAndShowCursor:wasOn.
+        "/ self cursorCol:(cursorCol - 1)
     ] ifFalse:[
         cursorLine ~~ 1 ifTrue:[
             self st80EditMode ifTrue:[
@@ -4526,19 +4533,21 @@
 basicDeleteCharsAtLine:lineNr fromCol:startCol toCol:endCol
     "delete characters from startCol to endCol in line lineNr"
 
-    |line lineSize newLine start stop prevWidth newWidth|
+    |line lineSize newLine start stop 
+     prevWidth newWidth newCol|
 
     self unselect.
 
     cursorLine == lineNr ifTrue:[
         cursorCol >= startCol ifTrue:[
             cursorCol >= endCol ifTrue:[
-                cursorCol := startCol.
+                newCol := startCol.
             ] ifFalse:[
-                cursorCol := cursorCol - (endCol - startCol + 1).
+                newCol := cursorCol - (endCol - startCol + 1).
                 "/ self assert:(cursorCol >= 0).
-                cursorCol := cursorCol max:1.
-            ]
+                newCol := newCol max:1.
+            ].
+            self setCursorCol:newCol.
         ].
     ].
 
@@ -8567,7 +8576,8 @@
             ln := list at: cursorLine.
             newCursorCol := ln notEmptyOrNil ifTrue:[ln indexOfNonSeparator] ifFalse:[1].
             self selectFromLine:cursorLine col:newCursorCol toLine:cursorLine col:cursorCol-1.
-            cursorCol := newCursorCol.
+            "/ cursorCol := newCursorCol.
+            self setCursorCol:newCursorCol.
             typeOfSelection := nil
         ]
     ]
@@ -8620,7 +8630,8 @@
                 whileTrue:[newCursorCol := newCursorCol - 1].
 
             self selectFromLine:cursorLine col:cursorCol toLine:cursorLine col: newCursorCol.
-            cursorCol := newCursorCol.
+            "/ cursorCol := newCursorCol.
+            self setCursorCol:newCursorCol.
             typeOfSelection := nil
         ]
     ]