Preserve colon from previous tab-complete

This fixes the case when pinging multiple nicks and one of them needs to
be cycled through.
weechat-hashes
C. McEnroe 2020-08-18 10:09:54 -04:00
parent 10e953b8b5
commit 1891c77535
1 changed files with 3 additions and 1 deletions

4
edit.c
View File

@ -163,11 +163,13 @@ static void tabComplete(uint id) {
return;
}
bool colon = (tab.len >= 2 && buf[tab.pos + tab.len - 2] == L':');
delete(false, tab.pos, tab.len);
tab.len = n;
if (wcs[0] == L'\\' || wcschr(wcs, L' ')) {
reserve(tab.pos, tab.len);
} else if (wcs[0] != L'/' && !tab.pos) {
} else if (wcs[0] != L'/' && (!tab.pos || colon)) {
tab.len += 2;
reserve(tab.pos, tab.len);
buf[tab.pos + n + 0] = L':';