diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/edbox.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; |
