From 7c0d10714404d0ae82b3c570f0c9e44d0faeb565 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 21 Mar 2026 03:10:43 -0400 Subject: Ctrl-Insert toggles between insert and typeover modes (insert is still the default). --- src/edbox.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/edbox.c b/src/edbox.c index d3b0b11..b7287e5 100644 --- a/src/edbox.c +++ b/src/edbox.c @@ -11,6 +11,7 @@ char *old_edbox[EDBOX_SIZE]; static u16 old_len; +static int typeover; int edbox_visible = 0; static u16 edbox_pos; /* range 0 to EDBOX_SIZE - 1 */ @@ -65,7 +66,9 @@ void edbox_putc(char c) { if(!c) return; /* no inserting nulls */ - memmove(edit_box + edbox_pos + 1, edit_box + edbox_pos, EDBOX_SIZE - edbox_pos - 1); + if(!typeover) + memmove(edit_box + edbox_pos + 1, edit_box + edbox_pos, EDBOX_SIZE - edbox_pos - 1); + edit_box[edbox_pos] = c; if(edbox_pos < EDBOX_SIZE - 1) { edbox_pos++; @@ -229,6 +232,9 @@ static void normal_keystroke(void) { case CH_TAB: comp_complete(); break; + case 0xff: /* ctrl-insert */ + typeover = !typeover; + break; default: edbox_putc(c); break; -- cgit v1.2.3