ed

[hare] The standard editor
Log | Files | Refs | README | LICENSE

commit a8daa8d62cc7693f30ce906db8c523c789ab392f
parent 079ba6846f01b10a9520a151c5a836a85769e30c
Author: Byron Torres <b@torresjrjr.com>
Date:   Sun, 21 Jan 2024 00:16:48 +0000

undo progress

Diffstat:
Mcommand.ha | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/command.ha b/command.ha @@ -246,7 +246,9 @@ fn cmd_insert(s: *Session, cmd: *Command) (void | Error) = { const n = get_linenum(cmd.linenums, s.buf.cursor); const n = if (n == 0) 1z else n; - hist_newseq(s.buf); // TODO special case, zeros lines + if (len(cmd.textinput) > 0) + hist_newseq(s.buf); + for (let i = 0z; i < len(cmd.textinput); i += 1) { const line = alloc(Line{ text = cmd.textinput[i], ... }); buf_insert(s.buf, n + i, line); @@ -371,7 +373,7 @@ fn cmd_move(s: *Session, cmd: *Command) (void | Error) = { return InvalidDestination; if (n == b + 1) - return; + return; // no-op const dest = if (n > b)