Merge pull request #1070 from Fmstrat/1065_double_whitespace

Check suffix for whitespace on tab completion
This commit is contained in:
Lorenz Hübschle-Schneider 2019-11-21 10:01:22 +01:00 committed by GitHub
commit 564764c7f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -144,7 +144,11 @@ IrcUtils.service('IrcUtils', [function() {
if (doIterate) {
// try iterating
newNick = _nextNick(iterCandidate, m[1], searchNickList);
if (suf.endsWith(' ')) {
beforeCaret = newNick + suf;
} else {
beforeCaret = newNick + suf + ' ';
}
return {
text: beforeCaret + afterCaret,
caretPos: beforeCaret.length,
@ -166,7 +170,11 @@ IrcUtils.service('IrcUtils', [function() {
// no match
return ret;
}
if (suf.endsWith(' ')) {
beforeCaret = newNick + suf;
} else {
beforeCaret = newNick + suf + ' ';
}
if (afterCaret[0] === ' ') {
// swallow first space after caret if any
afterCaret = afterCaret.substring(1);