From e53f614a04e7f78221d7ed673738c3a826c40880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Tue, 13 May 2014 12:16:05 +0100 Subject: [PATCH] Fix tab-completion of empty string Closes #301 --- js/glowingbear.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index e4f063f..79b5051 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -1233,9 +1233,12 @@ weechat.directive('inputBar', function() { // get current active buffer var activeBuffer = models.getActiveBuffer(); + // Empty input makes $scope.command undefined -- use empty string instead + var input = $scope.command || ''; + // complete nick - var nickComp = IrcUtils.completeNick($scope.command, caretPos, - $scope.iterCandidate, activeBuffer.getNicklistByTime(), ':'); + var nickComp = IrcUtils.completeNick(input, caretPos, $scope.iterCandidate, + activeBuffer.getNicklistByTime(), ':'); // remember iteration candidate $scope.iterCandidate = nickComp.iterCandidate;