From de41b7c0fac0eafda298f6b2e329f5661edb1774 Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Wed, 29 Apr 2020 20:10:36 +0200 Subject: [PATCH] Stop completion if only one possibility --- js/inputbar.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/inputbar.js b/js/inputbar.js index b817ad9..26d2c89 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -189,6 +189,11 @@ weechat.directive('inputBar', function() { inputNode.setSelectionRange(newCursorPos, newCursorPos); }, 0); + // If there is only one item in the list, we are done, no next cycle + if ( commandCompletionList.length === 1) { + previousInput = ''; + return; + } // Setup for the next cycle commandCompletionPositionInList++; commandCompletionBaseWord = replacedWord + suffix;