From 0b9b047188bc61043095839d2af0e414eced4688 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 18 Mar 2026 03:07:00 -0400 Subject: Tab completion getting better. Add a : after the nick, in channel screens. --- src/complete.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/complete.c') 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 { -- cgit v1.2.3