So I assume you came across something like this:
$ ./ed file
H
P
*,n
1 hello world
*a
foo
bar
baz
.
*u
*n
?
Invalid address
*
Interest bug!
This is actually a lack of an implementation of the undo command.
ed(1p):
That means a proper implementation would have to add a third "previous
cursor position" slot to the Addition and Deletion tuples, record those
throughout buffer.ha, and apply them in the undo & redo functions. That
would actually "restore the cursor" as your patch title says.
Seems here you've just had the cursor moved to a sensible place.
On Wed Mar 20, 2024 at 12:09 PM GMT, Curtis Arthaud wrote: