Merge branch 'forkbong-pretty_url'
This commit is contained in:
commit
391900cc99
@ -30,6 +30,7 @@ Changed
|
|||||||
- qutebrowser got a new (slightly updated) logo
|
- qutebrowser got a new (slightly updated) logo
|
||||||
- `:tab-focus` can now take a negative index to focus the nth tab counted from
|
- `:tab-focus` can now take a negative index to focus the nth tab counted from
|
||||||
the right.
|
the right.
|
||||||
|
- `:yank` can now yank the pretty/decoded URL by adding `--pretty`
|
||||||
|
|
||||||
v0.6.1
|
v0.6.1
|
||||||
-----
|
-----
|
||||||
|
@ -166,6 +166,7 @@ Contributors, sorted by the number of commits in descending order:
|
|||||||
* Philipp Hansch
|
* Philipp Hansch
|
||||||
* Kevin Velghe
|
* Kevin Velghe
|
||||||
* Austin Anderson
|
* Austin Anderson
|
||||||
|
* Panagiotis Ktistakis
|
||||||
* Alexey "Averrin" Nabrodov
|
* Alexey "Averrin" Nabrodov
|
||||||
* avk
|
* avk
|
||||||
* ZDarian
|
* ZDarian
|
||||||
@ -173,7 +174,6 @@ Contributors, sorted by the number of commits in descending order:
|
|||||||
* John ShaggyTwoDope Jenkins
|
* John ShaggyTwoDope Jenkins
|
||||||
* Jimmy
|
* Jimmy
|
||||||
* Peter Vilim
|
* Peter Vilim
|
||||||
* Panagiotis Ktistakis
|
|
||||||
* Clayton Craft
|
* Clayton Craft
|
||||||
* Oliver Caldwell
|
* Oliver Caldwell
|
||||||
* Jonas Schürmann
|
* Jonas Schürmann
|
||||||
|
@ -794,7 +794,7 @@ Save open pages and quit.
|
|||||||
|
|
||||||
[[yank]]
|
[[yank]]
|
||||||
=== yank
|
=== yank
|
||||||
Syntax: +:yank [*--title*] [*--sel*] [*--domain*]+
|
Syntax: +:yank [*--title*] [*--sel*] [*--domain*] [*--pretty*]+
|
||||||
|
|
||||||
Yank the current URL/title to the clipboard or primary selection.
|
Yank the current URL/title to the clipboard or primary selection.
|
||||||
|
|
||||||
@ -802,6 +802,7 @@ Yank the current URL/title to the clipboard or primary selection.
|
|||||||
* +*-t*+, +*--title*+: Yank the title instead of the URL.
|
* +*-t*+, +*--title*+: Yank the title instead of the URL.
|
||||||
* +*-s*+, +*--sel*+: Use the primary selection instead of the clipboard.
|
* +*-s*+, +*--sel*+: Use the primary selection instead of the clipboard.
|
||||||
* +*-d*+, +*--domain*+: Yank only the scheme, domain, and port number.
|
* +*-d*+, +*--domain*+: Yank only the scheme, domain, and port number.
|
||||||
|
* +*-p*+, +*--pretty*+: Yank the URL in pretty decoded form.
|
||||||
|
|
||||||
[[yank-selected]]
|
[[yank-selected]]
|
||||||
=== yank-selected
|
=== yank-selected
|
||||||
|
@ -654,13 +654,14 @@ class CommandDispatcher:
|
|||||||
frame.scroll(dx, dy)
|
frame.scroll(dx, dy)
|
||||||
|
|
||||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||||
def yank(self, title=False, sel=False, domain=False):
|
def yank(self, title=False, sel=False, domain=False, pretty=False):
|
||||||
"""Yank the current URL/title to the clipboard or primary selection.
|
"""Yank the current URL/title to the clipboard or primary selection.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
sel: Use the primary selection instead of the clipboard.
|
sel: Use the primary selection instead of the clipboard.
|
||||||
title: Yank the title instead of the URL.
|
title: Yank the title instead of the URL.
|
||||||
domain: Yank only the scheme, domain, and port number.
|
domain: Yank only the scheme, domain, and port number.
|
||||||
|
pretty: Yank the URL in pretty decoded form.
|
||||||
"""
|
"""
|
||||||
if title:
|
if title:
|
||||||
s = self._tabbed_browser.page_title(self._current_index())
|
s = self._tabbed_browser.page_title(self._current_index())
|
||||||
@ -672,8 +673,10 @@ class CommandDispatcher:
|
|||||||
':' + str(port) if port > -1 else '')
|
':' + str(port) if port > -1 else '')
|
||||||
what = 'domain'
|
what = 'domain'
|
||||||
else:
|
else:
|
||||||
s = self._current_url().toString(
|
flags = QUrl.RemovePassword
|
||||||
QUrl.FullyEncoded | QUrl.RemovePassword)
|
if not pretty:
|
||||||
|
flags |= QUrl.FullyEncoded
|
||||||
|
s = self._current_url().toString(flags)
|
||||||
what = 'URL'
|
what = 'URL'
|
||||||
|
|
||||||
if sel and QApplication.clipboard().supportsSelection():
|
if sel and QApplication.clipboard().supportsSelection():
|
||||||
|
@ -1448,6 +1448,8 @@ KEY_DATA = collections.OrderedDict([
|
|||||||
('yank -ts', ['yT']),
|
('yank -ts', ['yT']),
|
||||||
('yank -d', ['yd']),
|
('yank -d', ['yd']),
|
||||||
('yank -ds', ['yD']),
|
('yank -ds', ['yD']),
|
||||||
|
('yank -p', ['yp']),
|
||||||
|
('yank -ps', ['yP']),
|
||||||
('paste', ['pp']),
|
('paste', ['pp']),
|
||||||
('paste -s', ['pP']),
|
('paste -s', ['pP']),
|
||||||
('paste -t', ['Pp']),
|
('paste -t', ['Pp']),
|
||||||
|
@ -33,6 +33,18 @@ Feature: Yanking and pasting.
|
|||||||
Then the message "Yanked domain to clipboard: http://localhost:(port)" should be shown
|
Then the message "Yanked domain to clipboard: http://localhost:(port)" should be shown
|
||||||
And the clipboard should contain "http://localhost:(port)"
|
And the clipboard should contain "http://localhost:(port)"
|
||||||
|
|
||||||
|
Scenario: Yanking fully encoded URL
|
||||||
|
When I open data/title with spaces.html
|
||||||
|
And I run :yank
|
||||||
|
Then the message "Yanked URL to clipboard: http://localhost:(port)/data/title%20with%20spaces.html" should be shown
|
||||||
|
And the clipboard should contain "http://localhost:(port)/data/title%20with%20spaces.html"
|
||||||
|
|
||||||
|
Scenario: Yanking pretty decoded URL
|
||||||
|
When I open data/title with spaces.html
|
||||||
|
And I run :yank --pretty
|
||||||
|
Then the message "Yanked URL to clipboard: http://localhost:(port)/data/title with spaces.html" should be shown
|
||||||
|
And the clipboard should contain "http://localhost:(port)/data/title with spaces.html"
|
||||||
|
|
||||||
#### :paste
|
#### :paste
|
||||||
|
|
||||||
Scenario: Pasting an URL
|
Scenario: Pasting an URL
|
||||||
|
Loading…
Reference in New Issue
Block a user