Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7d9d171

Browse files
committed
change so that if someone enters invalid command with args we strict match
Signed-off-by: Michael Telatynski <[email protected]>
1 parent f5b12bd commit 7d9d171

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/autocomplete/CommandProvider.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,14 @@ export default class CommandProvider extends AutocompleteProvider {
4141
const {command, range} = this.getCurrentCommand(query, selection);
4242
if (!command) return [];
4343

44-
let matches;
44+
let matches = [];
4545
if (command[0] !== command[1]) {
4646
// The input looks like a command with arguments, perform exact match
4747
const match = COMMANDS.find((o) => o.command === command[1]);
4848
if (match) {
4949
matches = [match];
5050
}
51-
}
52-
53-
// If we don't yet have matches
54-
if (!matches) {
51+
} else {
5552
if (query === '/') {
5653
// If they have just entered `/` show everything
5754
matches = COMMANDS;

0 commit comments

Comments
 (0)