Stop completion if only one possibility

This commit is contained in:
Jeremy Mahieu 2020-04-29 20:10:36 +02:00
parent f8608f4738
commit de41b7c0fa

View File

@ -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;