From 377f1b7ad3176d12ae274ca9f3b26f7b764493c7 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 2 Oct 2020 21:40:30 +0200 Subject: vt: BS: *only* reset lcf if cursor is beyond right margin: don’t move cursor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed to make reverse auto-wrap work correctly. Without it, we’ll end up moving the cursor left one cell extra. --- vt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vt.c') diff --git a/vt.c b/vt.c index 6b6bbd0b..6cd5ead7 100644 --- a/vt.c +++ b/vt.c @@ -130,7 +130,10 @@ action_execute(struct terminal *term, uint8_t c) case '\b': /* backspace */ - term_cursor_left(term, 1); + if (term->grid->cursor.lcf) + term->grid->cursor.lcf = false; + else + term_cursor_left(term, 1); break; case '\t': { -- cgit v1.3