From 2fbadc46d21e5a76d94904e951105464c1acebfb Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Fri, 30 Jun 2017 09:57:39 -0700 Subject: [PATCH] Remove error when count is invalid to :tab-pin --- qutebrowser/browser/commands.py | 2 +- tests/end2end/features/tabs.feature | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index f21115db5..0b448a845 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -277,7 +277,7 @@ class CommandDispatcher: """ tab = self._cntwidget(count) if tab is None: - raise cmdexc.CommandError("Tab {} does not exist!".format(count)) + return to_pin = not tab.data.pinned self._tabbed_browser.set_tab_pinned(tab, to_pin) diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 1d3f22b10..8097f390e 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -1078,8 +1078,7 @@ Feature: Tab management And I open data/numbers/2.txt in a new tab And I open data/numbers/3.txt in a new tab And I run :tab-pin with count 23 - Then the error "Tab 23 does not exist!" should be shown - And the following tabs should be open: + Then the following tabs should be open: - data/numbers/1.txt - data/numbers/2.txt - data/numbers/3.txt (active)