From 7a4a4a4a4e582074a68c457bf12aeb62dbea7027 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 19 Mar 2015 22:19:25 +0100 Subject: [PATCH] Pass tab_id correctly with scope='tab' commands. Fixes #563. --- qutebrowser/commands/command.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qutebrowser/commands/command.py b/qutebrowser/commands/command.py index abdfa323c..437355cb7 100644 --- a/qutebrowser/commands/command.py +++ b/qutebrowser/commands/command.py @@ -362,10 +362,17 @@ class Command: args: The positional argument list. Gets modified directly. """ assert param.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD - if self._scope is not 'window': + if self._scope == 'global': + tab_id = None win_id = None - obj = objreg.get(self._instance, scope=self._scope, - window=win_id) + elif self._scope == 'tab': + tab_id = 'current' + elif self._scope == 'window': + tab_id = None + else: + raise ValueError("Invalid scope {}!".format(self._scope)) + obj = objreg.get(self._instance, scope=self._scope, window=win_id, + tab=tab_id) args.append(obj) def _get_count_arg(self, param, args, kwargs):