diff options
Diffstat (limited to 'src/edbox.c')
| -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) { |
