Merge pull request #786 from Gibstick/fix-bracket-nickcomplete

fix nick completion within brackets #781
This commit is contained in:
Lorenz Hübschle-Schneider 2016-06-26 13:34:46 +02:00 committed by GitHub
commit 1d6cbcb0e8
1 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ IrcUtils.service('IrcUtils', [function() {
var foundNick = null;
nickList.some(function(nick) {
if (nick.toLowerCase().search(candidate.toLowerCase()) === 0) {
if (nick.toLowerCase().indexOf(candidate.toLowerCase()) === 0) {
// found!
foundNick = nick;
return true;
@ -72,7 +72,7 @@ IrcUtils.service('IrcUtils', [function() {
// collect matching nicks
for (var i = 0; i < nickList.length; ++i) {
var lcNick = nickList[i].toLowerCase();
if (lcNick.search(escapeRegExp(lcIterCandidate)) === 0) {
if (lcNick.indexOf(lcIterCandidate) === 0) {
matchingNicks.push(nickList[i]);
if (lcCurrentNick === lcNick) {
at = matchingNicks.length - 1;
@ -158,7 +158,7 @@ IrcUtils.service('IrcUtils', [function() {
m = beforeCaret.match(/^([a-zA-Z0-9_\\\[\]{}^`|-]+)$/);
if (m) {
// try completing
newNick = _completeSingleNick(escapeRegExp(m[1]), searchNickList);
newNick = _completeSingleNick(m[1], searchNickList);
if (newNick === null) {
// no match
return ret;