commit 851cf0c7d42d4b065cdbe996898cd339ec0984f6
parent 13ed056e61ea2ba5177a8b9dc08e85d5387b9e06
Author: Byron Torres <b@torresjrjr.com>
Date: Wed, 10 Jan 2024 01:12:20 +0000
cmd_join(): fix cursor bug
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/command.ha b/command.ha
@@ -267,9 +267,8 @@ fn cmd_join(s: *Session, cmd: *Command) (void | Error) = {
for (let n = a; n <= b; n += 1) {
const line = s.buf.lines[n];
append(ls, line.text);
- if (mark == NUL) {
+ if (mark == NUL)
mark = line.mark;
- };
};
const newtext = strings::concat(ls...);
@@ -282,6 +281,7 @@ fn cmd_join(s: *Session, cmd: *Command) (void | Error) = {
buf_delete(s.buf, a, b);
buf_insert(s.buf, a, newline);
+ s.buf.cursor = a;
printmode(s, cmd)?;
};