aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-21 03:10:43 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-21 03:10:43 -0400
commit7c0d10714404d0ae82b3c570f0c9e44d0faeb565 (patch)
treecf7175c13361be35a99ef2a08149e602fac8e81b
parent5c2d15d1f204b007e90390db4ccda0fbaf5c58fb (diff)
downloadfujinet-chat-7c0d10714404d0ae82b3c570f0c9e44d0faeb565.tar.gz
Ctrl-Insert toggles between insert and typeover modes (insert is still the default).
-rw-r--r--TODO1
-rw-r--r--src/edbox.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/TODO b/TODO
index 52a1e34..2e52b4e 100644
--- a/TODO
+++ b/TODO
@@ -12,7 +12,6 @@ FujiChat features, we're almost at parity!
Other stuff:
-- Make ctrl-insert toggle between insert and typeover mode (The_Doctor__).
- Make control + 1 through 7 switch windows (same as Start), because
the XEGS and 1200XL Start keys are hard to reach while typing (brad
and MarkG).
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;