diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-03-17 05:52:37 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-03-17 05:52:37 -0400 |
| commit | ded1053f8b525e78d1121fd7f0a764ec5cc8cc05 (patch) | |
| tree | e3872cde44718589276550ede7d9aae4ebd75c07 /src/edbox.c | |
| parent | e3b45c4788189bd04ed4cf9806191363715419ce (diff) | |
| download | fujinet-chat-ded1053f8b525e78d1121fd7f0a764ec5cc8cc05.tar.gz | |
Tab complete PM nics (private screen only). Also, no need to prefix messages with /m in server or private screens.
Diffstat (limited to 'src/edbox.c')
| -rw-r--r-- | src/edbox.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/edbox.c b/src/edbox.c index 6ac1e7c..5d529d3 100644 --- a/src/edbox.c +++ b/src/edbox.c @@ -5,12 +5,13 @@ #include "screen.h" #include "edbox.h" #include "keyclick.h" +#include "complete.h" /* TODO: tab completion */ int edbox_visible = 0; static u16 edbox_pos; /* range 0 to EDBOX_SIZE - 1 */ -static u16 edbox_len; /* idem */ +u16 edbox_len; /* idem */ void (*edbox_callback)(void); @@ -133,6 +134,9 @@ static void normal_keystroke(void) { c = cgetc(); + if(c != CH_TAB) + comp_complete_done(); + switch(c) { case CH_EOL: // hide_cursor(); // already done by the caller @@ -189,6 +193,9 @@ static void normal_keystroke(void) { case 0x05: /* ^E */ edbox_pos = edbox_len; break; + case CH_TAB: + comp_complete(); + break; default: edbox_putc(c); break; @@ -264,3 +271,11 @@ void edbox_keystroke(void) { if(edbox_visible) edbox_show(); show_cursor(); } + +void edbox_set(char *contents) { + edbox_clear(); + while(*contents) { + edit_box[edbox_len++] = *contents++; + } + edbox_pos = edbox_len; +} |
