diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-11-01 19:30:20 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-11-01 19:30:20 -0700 |
commit | 448ed19e9cf060e63eaa2a6501e0a29f8b48f6c6 (patch) | |
tree | cea4b9886d73c4a89e397a190dcf916c439450ef | |
parent | 7485e6418a41c9a56006b5dfb087b684285b694d (diff) | |
download | txr-448ed19e9cf060e63eaa2a6501e0a29f8b48f6c6.tar.gz txr-448ed19e9cf060e63eaa2a6501e0a29f8b48f6c6.tar.bz2 txr-448ed19e9cf060e63eaa2a6501e0a29f8b48f6c6.zip |
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.
-rw-r--r-- | linenoise/linenoise.c | 1 |
1 files changed, 1 insertions, 0 deletions
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) |