From 448ed19e9cf060e63eaa2a6501e0a29f8b48f6c6 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 1 Nov 2018 19:30:20 -0700 Subject: linenoise: small move_cursor bugfix. * linenoise/linenoise.c (move_cursor): We must update the oldrow variable, expected by refresh_line to be tracking the row position of the cursor. This bug doesn't affect the current use of move_cursor for paren_jump, because that logic moves the cursor to the original position, which makes the oldrow value correct, and refresh_line is never called in between. If we want to use move_cursor in more situations, this has to be fixed. --- linenoise/linenoise.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index 081533a8..afc4e187 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -1270,6 +1270,7 @@ static void move_cursor_multiline(lino_t *l, int npos) (void) lino_os.puts_fn(l->tty_ofs, ab.b); ab_free(&ab); l->dpos = npos; + l->oldrow = nrow; } static void move_cursor(lino_t *l, int npos) -- cgit v1.2.3