From 12c959052452587a559bb55c717ced5321594474 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 17 Oct 2017 15:01:37 +0200 Subject: [PATCH] Always use shortest match for completion.use_best_match --- qutebrowser/commands/runners.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/commands/runners.py b/qutebrowser/commands/runners.py index 52c4ea613..fadb6c063 100644 --- a/qutebrowser/commands/runners.py +++ b/qutebrowser/commands/runners.py @@ -214,7 +214,8 @@ class CommandParser: Return: cmdstr modified to the matching completion or unmodified """ - matches = [cmd for cmd in cmdutils.cmd_dict if cmdstr in cmd] + matches = [cmd for cmd in sorted(cmdutils.cmd_dict, key=len) + if cmdstr in cmd] if len(matches) == 1: cmdstr = matches[0] elif len(matches) > 1 and config.val.completion.use_best_match: