EditTextView.st
branchjv
changeset 5417 213089a29fb8
parent 5406 17c0dd588915
parent 5414 87ff3f9cbe55
child 5503 daccdb3507d3
--- a/EditTextView.st	Wed Sep 02 06:46:05 2015 +0200
+++ b/EditTextView.st	Fri Sep 04 06:43:27 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
@@ -1317,7 +1319,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.
@@ -1325,6 +1328,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) ? ''.
@@ -1353,7 +1359,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
 !
@@ -1368,11 +1375,18 @@
     "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.
+     See replaceContentsWith:newContents for an undoable version of this"
+
+    self contents:aStringOrStringCollectionOrNil keepUndoHistory:false.
 !
 
 contents:something keepUndoHistory:keepUndoHistory
+    "set the contents and optionally clear the undo history.
+     The contents-change is not undoable."
+
     super contents:something.
     keepUndoHistory ifFalse:[
         undoSupport resetHistories.
@@ -1455,7 +1469,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|
 
@@ -1486,6 +1502,9 @@
 !
 
 setContents:something
+    "replace the whole contents by something new 
+     AND clear the remembered undo actions"
+
     |selType|
 
     undoSupport resetHistories.
@@ -3721,7 +3740,7 @@
 !
 
 replaceCharAtCursor:aCharacter
-    "replace a single character at cursor-position - advance cursor"
+    "undoably replace a single character at cursor-position - advance cursor"
 
     |wasOn|
 
@@ -3738,7 +3757,7 @@
 !
 
 replaceContentsWith:newContents
-    "replace everything"
+    "undoably replace everything"
 
     |originalContents|
 
@@ -3748,7 +3767,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.
@@ -3756,7 +3775,7 @@
 !
 
 replaceLine:lineNr with:newText
-    "replace a line at lineNr"
+    "undoably replace a line at lineNr"
 
     |originalLine|
 
@@ -3772,7 +3791,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"
@@ -3803,14 +3822,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
@@ -3819,7 +3838,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"
 
@@ -3880,7 +3899,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|