class: EditTextView
authorClaus Gittinger <cg@exept.de>
Thu, 03 Sep 2015 11:41:01 +0200
changeset 5413 b21cbb97c038
parent 5412 d248d42bac05
child 5414 87ff3f9cbe55
class: EditTextView comment/format in:15 methods
EditTextView.st
--- a/EditTextView.st	Thu Sep 03 10:10:03 2015 +0200
+++ b/EditTextView.st	Thu Sep 03 11:41:01 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
@@ -1250,7 +1252,8 @@
 !EditTextView methodsFor:'accessing-contents'!
 
 at:lineNr basicPut:aLine
-    "change a line without change notification"
+    "change a line without change notification.
+     this is not undoably, unless you care for yourself"
 
     (self at:lineNr) = aLine ifFalse:[
         super at:lineNr put:aLine.
@@ -1258,6 +1261,9 @@
 !
 
 at:lineNr put:aLine
+    "replace a line by something new.
+     this is not undoably, unless you care for yourself"
+
     |oldLine|
 
     oldLine := (self at:lineNr) ? ''.
@@ -1286,7 +1292,8 @@
 characterUnderCursor
     "return the character under the cursor - space if beyond line.
      For non-block cursors, this is the character immediately to the right
-     of the insertion-bar or caret."
+     of the insertion-bar or caret. 
+     For block cursors, this is the highlighted cursor-character"
 
     ^ self characterAtLine:cursorLine col:cursorCol
 !
@@ -1301,8 +1308,11 @@
     "Modified: / 04-07-2006 / 19:22:32 / fm"
 !
 
-contents:something
-    self contents:something keepUndoHistory:false.
+contents:aStringOrStringCollectionOrNil
+    "replace the whole contents by something new.
+     this is not undoably, unless you care for yourself"
+
+    self contents:aStringOrStringCollectionOrNil keepUndoHistory:false.
 !
 
 contents:something keepUndoHistory:keepUndoHistory
@@ -1388,7 +1398,9 @@
 !
 
 list:something
-    "position cursor home when setting contents"
+    "replace the whole contents by something new.
+     this is not undoably, unless you care for yourself.
+     position cursor home when setting contents"
 
     |prevCursorLine prevCursorCol|
 
@@ -1419,6 +1431,9 @@
 !
 
 setContents:something
+    "replace the whole contents by something new 
+     AND clear the remembered undo actions"
+
     |selType|
 
     undoSupport resetHistories.
@@ -3654,7 +3669,7 @@
 !
 
 replaceCharAtCursor:aCharacter
-    "replace a single character at cursor-position - advance cursor"
+    "undoably replace a single character at cursor-position - advance cursor"
 
     |wasOn|
 
@@ -3671,7 +3686,7 @@
 !
 
 replaceContentsWith:newContents
-    "replace everything"
+    "undoably replace everything"
 
     |originalContents|
 
@@ -3681,7 +3696,7 @@
 !
 
 replaceFromCharacterPosition:charPos1 to:charPos2 with:newString
-    "replace a substring at a character position"
+    "undoably replace a substring at a character position"
 
     "/ sigh - insert first, to avoid trouble due to shifing-in virtual line ends
     self insertString:newString atCharacterPosition:charPos1.
@@ -3689,7 +3704,7 @@
 !
 
 replaceLine:lineNr with:newText
-    "replace a line at lineNr"
+    "undoably replace a line at lineNr"
 
     |originalLine|
 
@@ -3705,7 +3720,7 @@
 !
 
 replaceLines:lines withCR:withCr
-    "replace a bunch of lines at cursor position. Cursor
+    "undoably a bunch of lines at cursor position. Cursor
      is moved behind replacement.
      If withCr is true, move to the beginning of the next line
      after the last line"
@@ -3736,14 +3751,14 @@
 !
 
 replaceSelectionBy:something
-    "delete the selection (if any) and insert something, a character or string;
+    "undoably delete the selection (if any) and insert something, a character or string;
      leave cursor after insertion"
 
     self replaceSelectionBy:something keepCursor:false select:false
 !
 
 replaceSelectionBy:something keepCursor:keep
-    "delete the selection (if any) and insert something, a character or string;
+    "undoably delete the selection (if any) and insert something, a character or string;
      leave cursor after insertion or leave it, depending on keep"
 
     self replaceSelectionBy:something keepCursor:keep select:false
@@ -3752,7 +3767,7 @@
 !
 
 replaceSelectionBy:something keepCursor:keep select:selectNewText
-    "delete the selection (if any) and insert something, a character or string;
+    "undoably delete the selection (if any) and insert something, a character or string;
      leave cursor after insertion or leave it, depending on keep.
      If selectNewText is true, select the new text; otherwise deselect"
 
@@ -3813,7 +3828,7 @@
 !
 
 replaceString:aString atLine:lineNr col:colNr
-    "replace multiple characters starting at lineNr/colNr.
+    "undoably replace multiple characters starting at lineNr/colNr.
      This is not prepared to encounter special chars (except TAB) in the string."
 
     |originalString|