From 7d9d17145c125db962a0eff3bbcd4a065c5b403e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 20 Jun 2018 17:21:06 +0100 Subject: [PATCH] change so that if someone enters invalid command with args we strict match Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/autocomplete/CommandProvider.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/autocomplete/CommandProvider.js b/src/autocomplete/CommandProvider.js index ea271e02ff..4b24e98605 100644 --- a/src/autocomplete/CommandProvider.js +++ b/src/autocomplete/CommandProvider.js @@ -41,17 +41,14 @@ export default class CommandProvider extends AutocompleteProvider { const {command, range} = this.getCurrentCommand(query, selection); if (!command) return []; - let matches; + let matches = []; if (command[0] !== command[1]) { // The input looks like a command with arguments, perform exact match const match = COMMANDS.find((o) => o.command === command[1]); if (match) { matches = [match]; } - } - - // If we don't yet have matches - if (!matches) { + } else { if (query === '/') { // If they have just entered `/` show everything matches = COMMANDS;