From 377f1b7ad3176d12ae274ca9f3b26f7b764493c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 2 Oct 2020 21:40:30 +0200 Subject: [PATCH] =?UTF-8?q?vt:=20BS:=20*only*=20reset=20lcf=20if=20cursor?= =?UTF-8?q?=20is=20beyond=20right=20margin:=20don=E2=80=99t=20move=20curso?= =?UTF-8?q?r?= 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(-) 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': {