diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-03-21 03:10:43 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-03-21 03:10:43 -0400 |
| commit | 7c0d10714404d0ae82b3c570f0c9e44d0faeb565 (patch) | |
| tree | cf7175c13361be35a99ef2a08149e602fac8e81b /src | |
| parent | 5c2d15d1f204b007e90390db4ccda0fbaf5c58fb (diff) | |
| download | fujinet-chat-7c0d10714404d0ae82b3c570f0c9e44d0faeb565.tar.gz | |
Ctrl-Insert toggles between insert and typeover modes (insert is still the default).
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; |
