Pass tab_id correctly with scope='tab' commands.

Fixes #563.
This commit is contained in:
Florian Bruhin 2015-03-19 22:19:25 +01:00
parent 218822d6e8
commit 7a4a4a4a4e

View File

@ -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):