Merge pull request #1070 from Fmstrat/1065_double_whitespace
Check suffix for whitespace on tab completion
This commit is contained in:
commit
564764c7f0
|
@ -144,7 +144,11 @@ IrcUtils.service('IrcUtils', [function() {
|
|||
if (doIterate) {
|
||||
// try iterating
|
||||
newNick = _nextNick(iterCandidate, m[1], searchNickList);
|
||||
beforeCaret = newNick + suf + ' ';
|
||||
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;
|
||||
}
|
||||
beforeCaret = newNick + suf + ' ';
|
||||
if (suf.endsWith(' ')) {
|
||||
beforeCaret = newNick + suf;
|
||||
} else {
|
||||
beforeCaret = newNick + suf + ' ';
|
||||
}
|
||||
if (afterCaret[0] === ' ') {
|
||||
// swallow first space after caret if any
|
||||
afterCaret = afterCaret.substring(1);
|
||||
|
|
Loading…
Reference in New Issue