From e6749dcf9f1e604315d5ec830cb380bd91166402 Mon Sep 17 00:00:00 2001 From: Marc Jauvin Date: Sat, 10 Feb 2018 09:57:08 -0500 Subject: [PATCH] [count] overrides win_id for tab-give cmd - Resolves #3548 --- qutebrowser/browser/commands.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index a59cdac25..8fd3426c0 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -533,14 +533,19 @@ class CommandDispatcher: @cmdutils.register(instance='command-dispatcher', scope='window') @cmdutils.argument('win_id', completion=miscmodels.window) - def tab_give(self, win_id: int = None): + @cmdutils.argument('count', count=True) + def tab_give(self, win_id: int = None, count=None): """Give the current tab to a new or existing window if win_id given. If no win_id is given, the tab will get detached into a new window. Args: win_id: The window ID of the window to give the current tab to. + count: [count] overrides win_id (index starts at 1 for win_id=0) """ + if count is not None: + win_id = count - 1 + if win_id == self._win_id: raise cmdexc.CommandError("Can't give a tab to the same window")