From bfa518896a695f0545dedb708f4e6db5667a9dd8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 30 Nov 2018 16:23:34 +0100 Subject: [PATCH] Fix Command.takes_count Before, what this actually did was checking the .count argument of a string (the *keys* in self._qute_args). Therefore, it always returned True as soon as a command had any @cmdutils.argument decorator. --- qutebrowser/commands/command.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qutebrowser/commands/command.py b/qutebrowser/commands/command.py index 5e9130b0b..0904abf95 100644 --- a/qutebrowser/commands/command.py +++ b/qutebrowser/commands/command.py @@ -537,7 +537,10 @@ class Command: def takes_count(self): """Return true iff this command can take a count argument.""" - return any(arg.count for arg in self._qute_args) + count_values = [usertypes.CommandValue.count, + usertypes.CommandValue.count_tab] + return any(info.value in count_values + for info in self._qute_args.values()) def register(self): """Register this command in objects.commands."""