fixed undo within a global command (would corrupt the buffer)
[unix-history] / bin / ed / POSIX
index dd506fb..47a80b9 100644 (file)
@@ -48,3 +48,15 @@ Though ed is not a binary editor, it can be used (if painfully) to edit
 binary files.  To assist in binary editing, when a file containing at
 least one ASCII NUL character is written, a newline is not appended
 if it did not already contain one upon reading.
 binary files.  To assist in binary editing, when a file containing at
 least one ASCII NUL character is written, a newline is not appended
 if it did not already contain one upon reading.
+
+Since the behavior of `u' (undo) within a `g' (global) command list is
+not specified by POSIX D11/2, it follows the behavior of the SunOS ed
+(this is the best way, I think, in that the alternatives are either too
+complicated to implement or too confusing to use):  undo forces a global
+command list to be executed only once, rather than for each line matching
+a global pattern.  In addtion, each instance of `u' within a global command
+undoes all previous commands (including undo's) in the command list.
+
+The `m' (move) command within a `g' command list also follows the SunOS
+ed implementation: any moved lines are removed from the global command's
+`active' list.