Skip to content

Commit e00e95e

Browse files
committed
Trigger line erase when moving through history
1 parent 93829e5 commit e00e95e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/mp-readline/readline.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ int readline_process_char(int c) {
279279
redraw_step_back = rl.cursor_pos - rl.orig_line_len;
280280
redraw_from_cursor = true;
281281
redraw_step_forward = rl.line->len - rl.orig_line_len;
282+
// We need to trigger a line erase because we don't know if the new line is longer
283+
// when taking continuation characters into account
284+
last_line_len = rl.line->len+1;
282285
}
283286
} else if (c == 'B') {
284287
#if MICROPY_REPL_EMACS_KEYS
@@ -299,6 +302,9 @@ int readline_process_char(int c) {
299302
redraw_step_back = rl.cursor_pos - rl.orig_line_len;
300303
redraw_from_cursor = true;
301304
redraw_step_forward = rl.line->len - rl.orig_line_len;
305+
// We need to trigger a line erase because we don't know if the new line is longer
306+
// when taking continuation characters into account
307+
last_line_len = rl.line->len+1;
302308
}
303309
} else if (c == 'C') {
304310
#if MICROPY_REPL_EMACS_KEYS

0 commit comments

Comments
 (0)