diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-03-15 04:24:26 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-03-15 04:24:26 -0400 |
| commit | ffebfdcc4f37d905ccb1a21105e2998b5af9bc55 (patch) | |
| tree | 156000413d1237aba1bf3a91d1a4404ee972c6c2 | |
| parent | 5778ecac27a763bc19ef52b5b99c8cc06bb0fa7b (diff) | |
| download | fujinet-chat-3836171c7efce873eb1c7c63176d22c6cfc9280d.tar.gz | |
Allow using the 240th character of the edit nox. And alert when trying to type past the end.pre-alpha
| -rw-r--r-- | src/edbox.c | 14 |
1 files 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) { |
