Merge branch 'haasn-winonly'
This commit is contained in:
commit
0058917b8d
@ -32,6 +32,7 @@ Added
|
|||||||
in rapid mode.
|
in rapid mode.
|
||||||
- New `{clipboard}` and `{primary}` replacements for the commandline which
|
- New `{clipboard}` and `{primary}` replacements for the commandline which
|
||||||
replace the `:paste` command.
|
replace the `:paste` command.
|
||||||
|
- New `:window-only` command to close all other windows.
|
||||||
|
|
||||||
Changed
|
Changed
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
@ -169,13 +169,13 @@ Contributors, sorted by the number of commits in descending order:
|
|||||||
* Alexey "Averrin" Nabrodov
|
* Alexey "Averrin" Nabrodov
|
||||||
* avk
|
* avk
|
||||||
* ZDarian
|
* ZDarian
|
||||||
|
* Niklas Haas
|
||||||
* Milan Svoboda
|
* Milan Svoboda
|
||||||
* John ShaggyTwoDope Jenkins
|
* John ShaggyTwoDope Jenkins
|
||||||
* Peter Vilim
|
* Peter Vilim
|
||||||
* Clayton Craft
|
* Clayton Craft
|
||||||
* nanjekyejoannah
|
* nanjekyejoannah
|
||||||
* Oliver Caldwell
|
* Oliver Caldwell
|
||||||
* Niklas Haas
|
|
||||||
* Jonas Schürmann
|
* Jonas Schürmann
|
||||||
* error800
|
* error800
|
||||||
* Michael Hoang
|
* Michael Hoang
|
||||||
|
@ -68,6 +68,7 @@
|
|||||||
|<<unbind,unbind>>|Unbind a keychain.
|
|<<unbind,unbind>>|Unbind a keychain.
|
||||||
|<<undo,undo>>|Re-open a closed tab (optionally skipping [count] closed tabs).
|
|<<undo,undo>>|Re-open a closed tab (optionally skipping [count] closed tabs).
|
||||||
|<<view-source,view-source>>|Show the source of the current page.
|
|<<view-source,view-source>>|Show the source of the current page.
|
||||||
|
|<<window-only,window-only>>|Close all windows except for the current one.
|
||||||
|<<wq,wq>>|Save open pages and quit.
|
|<<wq,wq>>|Save open pages and quit.
|
||||||
|<<yank,yank>>|Yank something to the clipboard or primary selection.
|
|<<yank,yank>>|Yank something to the clipboard or primary selection.
|
||||||
|<<zoom,zoom>>|Set the zoom level for the current tab.
|
|<<zoom,zoom>>|Set the zoom level for the current tab.
|
||||||
@ -844,6 +845,10 @@ Re-open a closed tab (optionally skipping [count] closed tabs).
|
|||||||
=== view-source
|
=== view-source
|
||||||
Show the source of the current page.
|
Show the source of the current page.
|
||||||
|
|
||||||
|
[[window-only]]
|
||||||
|
=== window-only
|
||||||
|
Close all windows except for the current one.
|
||||||
|
|
||||||
[[wq]]
|
[[wq]]
|
||||||
=== wq
|
=== wq
|
||||||
Syntax: +:wq ['name']+
|
Syntax: +:wq ['name']+
|
||||||
|
@ -247,3 +247,12 @@ def log_capacity(capacity: int):
|
|||||||
raise cmdexc.CommandError("Can't set a negative log capacity!")
|
raise cmdexc.CommandError("Can't set a negative log capacity!")
|
||||||
else:
|
else:
|
||||||
log.ram_handler.change_log_capacity(capacity)
|
log.ram_handler.change_log_capacity(capacity)
|
||||||
|
|
||||||
|
|
||||||
|
@cmdutils.register()
|
||||||
|
@cmdutils.argument('current_win_id', win_id=True)
|
||||||
|
def window_only(current_win_id):
|
||||||
|
"""Close all windows except for the current one."""
|
||||||
|
for win_id, window in objreg.window_registry.items():
|
||||||
|
if win_id != current_win_id:
|
||||||
|
window.close()
|
||||||
|
@ -108,7 +108,7 @@ Feature: Going back and forward.
|
|||||||
And the message "Still alive!" should be shown
|
And the message "Still alive!" should be shown
|
||||||
|
|
||||||
Scenario: Going back in a new window
|
Scenario: Going back in a new window
|
||||||
Given I have a fresh instance
|
Given I clean up open tabs
|
||||||
When I open data/backforward/1.txt
|
When I open data/backforward/1.txt
|
||||||
And I open data/backforward/2.txt
|
And I open data/backforward/2.txt
|
||||||
And I run :back -w
|
And I run :back -w
|
||||||
|
@ -139,6 +139,15 @@ def fresh_instance(quteproc):
|
|||||||
quteproc.start()
|
quteproc.start()
|
||||||
|
|
||||||
|
|
||||||
|
@bdd.given("I clean up open tabs")
|
||||||
|
def clean_open_tabs(quteproc):
|
||||||
|
"""Clean up open windows and tabs."""
|
||||||
|
quteproc.set_setting('tabs', 'last-close', 'blank')
|
||||||
|
quteproc.send_cmd(':window-only')
|
||||||
|
quteproc.send_cmd(':tab-only')
|
||||||
|
quteproc.send_cmd(':tab-close')
|
||||||
|
|
||||||
|
|
||||||
## When
|
## When
|
||||||
|
|
||||||
|
|
||||||
|
@ -525,6 +525,20 @@ Feature: Various utility commands.
|
|||||||
- data/hints/link_blank.html
|
- data/hints/link_blank.html
|
||||||
- data/hello.txt (active)
|
- data/hello.txt (active)
|
||||||
|
|
||||||
|
@no_xvfb
|
||||||
|
Scenario: :window-only
|
||||||
|
Given I run :tab-only
|
||||||
|
And I open data/hello.txt
|
||||||
|
When I open data/hello2.txt in a new tab
|
||||||
|
And I open data/hello3.txt in a new window
|
||||||
|
And I run :window-only
|
||||||
|
Then the session should look like:
|
||||||
|
windows:
|
||||||
|
- tabs:
|
||||||
|
- active: true
|
||||||
|
history:
|
||||||
|
- url: http://localhost:*/data/hello3.txt
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
|
|
||||||
Scenario: {url} as part of an argument
|
Scenario: {url} as part of an argument
|
||||||
|
@ -263,8 +263,7 @@ Feature: Tab management
|
|||||||
Then the error "There's no tab with index -1!" should be shown
|
Then the error "There's no tab with index -1!" should be shown
|
||||||
|
|
||||||
Scenario: :tab-focus last with no last focused tab
|
Scenario: :tab-focus last with no last focused tab
|
||||||
Given I have a fresh instance
|
When I run :tab-focus last
|
||||||
And I run :tab-focus last
|
|
||||||
Then the error "No last focused tab!" should be shown
|
Then the error "No last focused tab!" should be shown
|
||||||
|
|
||||||
# tab-prev/tab-next
|
# tab-prev/tab-next
|
||||||
@ -564,7 +563,6 @@ Feature: Tab management
|
|||||||
- data/hello2.txt
|
- data/hello2.txt
|
||||||
|
|
||||||
Scenario: Cloning to new window
|
Scenario: Cloning to new window
|
||||||
Given I have a fresh instance
|
|
||||||
When I open data/title.html
|
When I open data/title.html
|
||||||
And I run :tab-clone -w
|
And I run :tab-clone -w
|
||||||
Then the session should look like:
|
Then the session should look like:
|
||||||
@ -583,7 +581,6 @@ Feature: Tab management
|
|||||||
title: Test title
|
title: Test title
|
||||||
|
|
||||||
Scenario: Cloning with tabs-are-windows = true
|
Scenario: Cloning with tabs-are-windows = true
|
||||||
Given I have a fresh instance
|
|
||||||
When I open data/title.html
|
When I open data/title.html
|
||||||
And I set tabs -> tabs-are-windows to true
|
And I set tabs -> tabs-are-windows to true
|
||||||
And I run :tab-clone
|
And I run :tab-clone
|
||||||
@ -605,7 +602,6 @@ Feature: Tab management
|
|||||||
# :tab-detach
|
# :tab-detach
|
||||||
|
|
||||||
Scenario: Detaching a tab
|
Scenario: Detaching a tab
|
||||||
Given I have a fresh instance
|
|
||||||
When I open data/numbers/1.txt
|
When I open data/numbers/1.txt
|
||||||
And I open data/numbers/2.txt in a new tab
|
And I open data/numbers/2.txt in a new tab
|
||||||
And I run :tab-detach
|
And I run :tab-detach
|
||||||
@ -861,7 +857,6 @@ Feature: Tab management
|
|||||||
# :buffer
|
# :buffer
|
||||||
|
|
||||||
Scenario: :buffer without args
|
Scenario: :buffer without args
|
||||||
Given I have a fresh instance
|
|
||||||
When I run :buffer
|
When I run :buffer
|
||||||
Then the error "buffer: The following arguments are required: index" should be shown
|
Then the error "buffer: The following arguments are required: index" should be shown
|
||||||
|
|
||||||
@ -914,8 +909,8 @@ Feature: Tab management
|
|||||||
|
|
||||||
Scenario: :buffer with no matching window index
|
Scenario: :buffer with no matching window index
|
||||||
When I open data/title.html
|
When I open data/title.html
|
||||||
And I run :buffer "2/1"
|
And I run :buffer "99/1"
|
||||||
Then the error "There's no window with id 2!" should be shown
|
Then the error "There's no window with id 99!" should be shown
|
||||||
|
|
||||||
Scenario: :buffer with matching window index
|
Scenario: :buffer with matching window index
|
||||||
Given I have a fresh instance
|
Given I have a fresh instance
|
||||||
@ -947,7 +942,6 @@ Feature: Tab management
|
|||||||
- url: http://localhost:*/data/paste_primary.html
|
- url: http://localhost:*/data/paste_primary.html
|
||||||
|
|
||||||
Scenario: :buffer with wrong argument (-1)
|
Scenario: :buffer with wrong argument (-1)
|
||||||
Given I have a fresh instance
|
|
||||||
When I open data/title.html
|
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
|
Then the error "There's no tab with index -1!" should be shown
|
||||||
|
@ -19,10 +19,3 @@
|
|||||||
|
|
||||||
import pytest_bdd as bdd
|
import pytest_bdd as bdd
|
||||||
bdd.scenarios('tabs.feature')
|
bdd.scenarios('tabs.feature')
|
||||||
|
|
||||||
|
|
||||||
@bdd.given("I clean up open tabs")
|
|
||||||
def clean_open_tabs(quteproc):
|
|
||||||
quteproc.set_setting('tabs', 'last-close', 'blank')
|
|
||||||
quteproc.send_cmd(':tab-only')
|
|
||||||
quteproc.send_cmd(':tab-close')
|
|
||||||
|
@ -3,7 +3,7 @@ Feature: Yanking and pasting.
|
|||||||
from/to the clipboard and primary selection.
|
from/to the clipboard and primary selection.
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given I run :tab-only
|
Given I clean up open tabs
|
||||||
|
|
||||||
#### :yank
|
#### :yank
|
||||||
|
|
||||||
@ -79,9 +79,7 @@ Feature: Yanking and pasting.
|
|||||||
Then the error "Clipboard is empty." should be shown
|
Then the error "Clipboard is empty." should be shown
|
||||||
|
|
||||||
Scenario: Pasting in a new tab
|
Scenario: Pasting in a new tab
|
||||||
Given I open about:blank
|
When I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
||||||
When I run :tab-only
|
|
||||||
And I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
|
||||||
And I run :open -t {clipboard}
|
And I run :open -t {clipboard}
|
||||||
And I wait until data/hello.txt is loaded
|
And I wait until data/hello.txt is loaded
|
||||||
Then the following tabs should be open:
|
Then the following tabs should be open:
|
||||||
@ -89,9 +87,7 @@ Feature: Yanking and pasting.
|
|||||||
- data/hello.txt (active)
|
- data/hello.txt (active)
|
||||||
|
|
||||||
Scenario: Pasting in a background tab
|
Scenario: Pasting in a background tab
|
||||||
Given I open about:blank
|
When I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
||||||
When I run :tab-only
|
|
||||||
And I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
|
||||||
And I run :open -b {clipboard}
|
And I run :open -b {clipboard}
|
||||||
And I wait until data/hello.txt is loaded
|
And I wait until data/hello.txt is loaded
|
||||||
Then the following tabs should be open:
|
Then the following tabs should be open:
|
||||||
@ -99,7 +95,6 @@ Feature: Yanking and pasting.
|
|||||||
- data/hello.txt
|
- data/hello.txt
|
||||||
|
|
||||||
Scenario: Pasting in a new window
|
Scenario: Pasting in a new window
|
||||||
Given I have a fresh instance
|
|
||||||
When I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
When I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
||||||
And I run :open -w {clipboard}
|
And I run :open -w {clipboard}
|
||||||
And I wait until data/hello.txt is loaded
|
And I wait until data/hello.txt is loaded
|
||||||
@ -123,7 +118,6 @@ Feature: Yanking and pasting.
|
|||||||
Then the error "Invalid URL" should be shown
|
Then the error "Invalid URL" should be shown
|
||||||
|
|
||||||
Scenario: Pasting multiple urls in a new tab
|
Scenario: Pasting multiple urls in a new tab
|
||||||
Given I have a fresh instance
|
|
||||||
When I put the following lines into the clipboard:
|
When I put the following lines into the clipboard:
|
||||||
http://localhost:(port)/data/hello.txt
|
http://localhost:(port)/data/hello.txt
|
||||||
http://localhost:(port)/data/hello2.txt
|
http://localhost:(port)/data/hello2.txt
|
||||||
@ -139,8 +133,8 @@ Feature: Yanking and pasting.
|
|||||||
- data/hello3.txt
|
- data/hello3.txt
|
||||||
|
|
||||||
Scenario: Pasting multiline text
|
Scenario: Pasting multiline text
|
||||||
Given I have a fresh instance
|
When I set general -> auto-search to true
|
||||||
When I set searchengines -> DEFAULT to http://localhost:(port)/data/hello.txt?q={}
|
And I set searchengines -> DEFAULT to http://localhost:(port)/data/hello.txt?q={}
|
||||||
And I put the following lines into the clipboard:
|
And I put the following lines into the clipboard:
|
||||||
this url:
|
this url:
|
||||||
http://qutebrowser.org
|
http://qutebrowser.org
|
||||||
@ -152,9 +146,8 @@ Feature: Yanking and pasting.
|
|||||||
- data/hello.txt?q=this%20url%3A%0Ahttp%3A//qutebrowser.org%0Ashould%20not%20open (active)
|
- data/hello.txt?q=this%20url%3A%0Ahttp%3A//qutebrowser.org%0Ashould%20not%20open (active)
|
||||||
|
|
||||||
Scenario: Pasting multiline whose first line looks like a URI
|
Scenario: Pasting multiline whose first line looks like a URI
|
||||||
Given I open about:blank
|
When I set general -> auto-search to true
|
||||||
When I run :tab-only
|
And I set searchengines -> DEFAULT to http://localhost:(port)/data/hello.txt?q={}
|
||||||
When I set searchengines -> DEFAULT to http://localhost:(port)/data/hello.txt?q={}
|
|
||||||
And I put the following lines into the clipboard:
|
And I put the following lines into the clipboard:
|
||||||
text:
|
text:
|
||||||
should open
|
should open
|
||||||
@ -166,9 +159,7 @@ Feature: Yanking and pasting.
|
|||||||
- data/hello.txt?q=text%3A%0Ashould%20open%0Aas%20search (active)
|
- data/hello.txt?q=text%3A%0Ashould%20open%0Aas%20search (active)
|
||||||
|
|
||||||
Scenario: Pasting multiple urls in a background tab
|
Scenario: Pasting multiple urls in a background tab
|
||||||
Given I open about:blank
|
When I put the following lines into the clipboard:
|
||||||
When I run :tab-only
|
|
||||||
And I put the following lines into the clipboard:
|
|
||||||
http://localhost:(port)/data/hello.txt
|
http://localhost:(port)/data/hello.txt
|
||||||
http://localhost:(port)/data/hello2.txt
|
http://localhost:(port)/data/hello2.txt
|
||||||
http://localhost:(port)/data/hello3.txt
|
http://localhost:(port)/data/hello3.txt
|
||||||
@ -183,7 +174,6 @@ Feature: Yanking and pasting.
|
|||||||
- data/hello3.txt
|
- data/hello3.txt
|
||||||
|
|
||||||
Scenario: Pasting multiple urls in new windows
|
Scenario: Pasting multiple urls in new windows
|
||||||
Given I have a fresh instance
|
|
||||||
When I put the following lines into the clipboard:
|
When I put the following lines into the clipboard:
|
||||||
http://localhost:(port)/data/hello.txt
|
http://localhost:(port)/data/hello.txt
|
||||||
http://localhost:(port)/data/hello2.txt
|
http://localhost:(port)/data/hello2.txt
|
||||||
@ -216,13 +206,11 @@ Feature: Yanking and pasting.
|
|||||||
url: http://localhost:*/data/hello3.txt
|
url: http://localhost:*/data/hello3.txt
|
||||||
|
|
||||||
Scenario: Pasting multiple urls with an empty one
|
Scenario: Pasting multiple urls with an empty one
|
||||||
When I open about:blank
|
|
||||||
And I put "http://localhost:(port)/data/hello.txt\n\nhttp://localhost:(port)/data/hello2.txt" into the clipboard
|
And I put "http://localhost:(port)/data/hello.txt\n\nhttp://localhost:(port)/data/hello2.txt" into the clipboard
|
||||||
And I run :open -t {clipboard}
|
And I run :open -t {clipboard}
|
||||||
Then no crash should happen
|
Then no crash should happen
|
||||||
|
|
||||||
Scenario: Pasting multiple urls with an almost empty one
|
Scenario: Pasting multiple urls with an almost empty one
|
||||||
When I open about:blank
|
|
||||||
And I put "http://localhost:(port)/data/hello.txt\n \nhttp://localhost:(port)/data/hello2.txt" into the clipboard
|
And I put "http://localhost:(port)/data/hello.txt\n \nhttp://localhost:(port)/data/hello2.txt" into the clipboard
|
||||||
And I run :open -t {clipboard}
|
And I run :open -t {clipboard}
|
||||||
Then no crash should happen
|
Then no crash should happen
|
||||||
|
Loading…
Reference in New Issue
Block a user