From ffebfdcc4f37d905ccb1a21105e2998b5af9bc55 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 15 Mar 2026 04:24:26 -0400 Subject: Allow using the 240th character of the edit nox. And alert when trying to type past the end. --- src/edbox.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/edbox.c b/src/edbox.c index e3a1e85..b70ae2a 100644 --- a/src/edbox.c +++ b/src/edbox.c @@ -55,13 +55,19 @@ void edbox_hide(void) { etc). not sure if this is more or less annoying than just refusing to accept more input until Return is pressed. */ void edbox_putc(char c) { + extern void __fastcall__ bell(void); + if(!c) return; /* no inserting nulls */ - if((c != CH_EOL) && (edbox_pos == EDBOX_SIZE - 1)) - return; + memmove(edit_box + edbox_pos + 1, edit_box + edbox_pos, EDBOX_SIZE - edbox_pos - 1); - edit_box[edbox_pos++] = c; - edbox_len++; + edit_box[edbox_pos] = c; + if(edbox_pos < EDBOX_SIZE - 1) { + edbox_pos++; + edbox_len++; + } else { + bell(); + } } static void fake_keystroke(char c) { -- cgit v1.2.3