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