From 966aa810df9f1bd515926a069c5cd9178271722b Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Mon, 6 Nov 2017 06:41:43 +1100 Subject: [PATCH] Set maxsplit to 0 on :buffer Remove double quotes from tests --- qutebrowser/browser/commands.py | 3 ++- tests/end2end/features/tabs.feature | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 3d07e0de7..3aad6bf02 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1066,7 +1066,8 @@ class CommandDispatcher: return (tabbed_browser, tabbed_browser.widget(idx-1)) - @cmdutils.register(instance='command-dispatcher', scope='window') + @cmdutils.register(instance='command-dispatcher', scope='window', + maxsplit=0) @cmdutils.argument('index', completion=miscmodels.buffer) @cmdutils.argument('count', count=True) def buffer(self, index=None, count=None): diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 14461317b..e3f2f506a 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -884,7 +884,7 @@ Feature: Tab management When I open data/title.html And I open data/search.html in a new tab And I open data/scroll/simple.html in a new tab - And I run :buffer "Searching text" + And I run :buffer Searching text And I wait for "Current tab changed, focusing " in the log Then the following tabs should be open: - data/title.html @@ -892,7 +892,7 @@ Feature: Tab management - data/scroll/simple.html Scenario: :buffer with no matching title - When I run :buffer "invalid title" + When I run :buffer invalid title Then the error "No matching tab for: invalid title" should be shown Scenario: :buffer with matching title and two windows @@ -901,7 +901,7 @@ Feature: Tab management And I open data/scroll/simple.html in a new tab And I open data/caret.html in a new window And I open data/paste_primary.html in a new tab - And I run :buffer "Scrolling" + And I run :buffer Scrolling And I wait for "Focus object changed: *" in the log Then the session should look like: windows: @@ -924,12 +924,12 @@ Feature: Tab management Scenario: :buffer with no matching index When I open data/title.html - And I run :buffer "666" + And I run :buffer 666 Then the error "There's no tab with index 666!" should be shown Scenario: :buffer with no matching window index When I open data/title.html - And I run :buffer "99/1" + And I run :buffer 99/1 Then the error "There's no window with id 99!" should be shown @skip # Too flaky @@ -941,7 +941,7 @@ Feature: Tab management And I run :open -w http://localhost:(port)/data/caret.html And I open data/paste_primary.html in a new tab And I wait until data/caret.html is loaded - And I run :buffer "0/2" + And I run :buffer 0/2 And I wait for "Focus object changed: *" in the log Then the session should look like: windows: @@ -964,29 +964,29 @@ Feature: Tab management Scenario: :buffer with wrong argument (-1) When I open data/title.html - And I run :buffer "-1" + And I run :buffer -1 Then the error "There's no tab with index -1!" should be shown Scenario: :buffer with wrong argument (/) When I open data/title.html - And I run :buffer "/" + And I run :buffer / Then the following tabs should be open: - data/title.html (active) Scenario: :buffer with wrong argument (//) When I open data/title.html - And I run :buffer "//" + And I run :buffer // Then the following tabs should be open: - data/title.html (active) Scenario: :buffer with wrong argument (0/x) When I open data/title.html - And I run :buffer "0/x" + And I run :buffer 0/x Then the error "No matching tab for: 0/x" should be shown Scenario: :buffer with wrong argument (1/2/3) When I open data/title.html - And I run :buffer "1/2/3" + And I run :buffer 1/2/3 Then the error "No matching tab for: 1/2/3" should be shown # :tab-take