aboutsummaryrefslogtreecommitdiff
path: root/src/complete.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-18 03:07:00 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-18 03:07:00 -0400
commit0b9b047188bc61043095839d2af0e414eced4688 (patch)
tree1060687339b0847eaee1d15ceb14d5777f61cc63 /src/complete.c
parent2ae01c91c28ea8ce05266d1e121438af140b870f (diff)
downloadfujinet-chat-0b9b047188bc61043095839d2af0e414eced4688.tar.gz
Tab completion getting better. Add a : after the nick, in channel screens.
Diffstat (limited to 'src/complete.c')
-rw-r--r--src/complete.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/complete.c b/src/complete.c
index d168398..108bc90 100644
--- a/src/complete.c
+++ b/src/complete.c
@@ -12,7 +12,7 @@
#define MAX_PM_NICKS 10
-static char search_pos = 0, in_progress = 0;
+static char search_pos = 0, in_progress = 0, want_colon = 0;
static char prefix[33];
char comp_pm_nicks[MAX_PM_NICKS][25];
@@ -125,6 +125,7 @@ void comp_continue(void) {
while(search_pos < MAX_PM_NICKS) {
if(match(prefix, list[search_pos])) {
edbox_set(list[search_pos]);
+ if(want_colon) edbox_addchr(':');
edbox_space();
search_pos++;
return;
@@ -138,6 +139,7 @@ void comp_continue(void) {
void comp_start(void) {
char *p;
+ want_colon = 0;
if(scr_current == SCR_SERVER) {
p = last_chan;
list = comp_pm_chans;
@@ -145,15 +147,17 @@ void comp_start(void) {
p = last_pm_nick;
list = comp_pm_nicks;
} else if(scr_names[scr_current][0] == '#') {
- p = last_pm_nick; // XXX: there should be a last_hilite_nick!
find_chan_nicks();
list = comp_chan_nicks;
+ if(pm_nick_pos) p = comp_chan_nicks[pm_nick_pos - 1];
+ want_colon = 1;
}
/* just insert the last nick/chan if there's nothing to search for */
if(!edbox_len) {
if(*p) {
edbox_set(p);
+ if(want_colon) edbox_addchr(':');
edbox_space();
}
} else {