From 2e64dda592e81387d598d1c2301a374408fc6eb8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 17 Oct 2017 11:39:30 +0200 Subject: [PATCH] Clean up getting matching commands --- qutebrowser/commands/runners.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qutebrowser/commands/runners.py b/qutebrowser/commands/runners.py index a1f4accd7..52c4ea613 100644 --- a/qutebrowser/commands/runners.py +++ b/qutebrowser/commands/runners.py @@ -214,10 +214,7 @@ class CommandParser: Return: cmdstr modified to the matching completion or unmodified """ - matches = [] - for valid_command in cmdutils.cmd_dict: - if valid_command.find(cmdstr) == 0: - matches.append(valid_command) + matches = [cmd for cmd in cmdutils.cmd_dict if cmdstr in cmd] if len(matches) == 1: cmdstr = matches[0] elif len(matches) > 1 and config.val.completion.use_best_match: