aboutsummaryrefslogtreecommitdiff
path: root/src/complete.c
diff options
context:
space:
mode:
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 {