diff options
author | C. McEnroe | 2020-08-18 10:09:54 -0400 |
---|---|---|
committer | C. McEnroe | 2020-08-18 10:09:54 -0400 |
commit | 1891c775353907ae3ceb4d8e42243b508b450dab (patch) | |
tree | ea7940c18ea9dfdad33617803a3adaec3d7b0d26 /edit.c | |
parent | 10e953b8b5f86854a7065987f6fc98f5c2c40db1 (diff) |
Preserve colon from previous tab-complete
This fixes the case when pinging multiple nicks and one of them needs to be cycled through.
Diffstat (limited to 'edit.c')
-rw-r--r-- | edit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/edit.c b/edit.c index d63678d..34b89fe 100644 --- a/edit.c +++ b/edit.c @@ -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':'; |