change {yank_url} to {url:yank}

This commit is contained in:
Michael M 2023-09-18 09:01:39 -05:00
parent 1f9cc97429
commit 1b815695c8
No known key found for this signature in database
GPG Key ID: 7744D0A113FFE5E1
6 changed files with 7 additions and 7 deletions

View File

@ -29,7 +29,7 @@ Fixed
exceptions due to cats sleeping on numpads. (#7834)
- Ignored URL query parameters (via `url.yank_ignored_parameters`) are now
respected when yanking any URL (for example, through hints with `hint links
yank`). The `{yank_url}` subsitution has also been added as a version of
yank`). The `{url:yank}` subsitution has also been added as a version of
`{url}` that respects ignored URL query parameters. (#7879)
- Navigating via hints to a remote URL from a file:// one works again. (#7847)
- The timers related to the tab audible indicator and the auto follow timeout

View File

@ -14,7 +14,7 @@ For command arguments, there are also some variables you can use:
- `{url:host}`, `{url:domain}`, `{url:auth}`, `{url:scheme}`, `{url:username}`,
`{url:password}`, `{url:port}`, `{url:path}` and `{url:query}`
expand to the respective parts of the current URL
- `{yank_url}` expands to the URL of the current page but strips all the query
- `{url:yank}` expands to the URL of the current page but strips all the query
parameters in the `url.yank_ignored_parameters` setting.
- `{title}` expands to the current page's title
- `{clipboard}` expands to the clipboard contents

View File

@ -57,7 +57,7 @@ def _init_variable_replacements() -> Mapping[str, _ReplacementFunction]:
_url(tb).port()) if _url(tb).port() != -1 else "",
'url:path': lambda tb: _url(tb).path(),
'url:query': lambda tb: _url(tb).query(),
'yank_url': lambda tb: urlutils.get_url_yank_text(_url(tb), False),
'url:yank': lambda tb: urlutils.get_url_yank_text(_url(tb), False),
'title': lambda tb: tb.widget.page_title(tb.widget.currentIndex()),
'clipboard': lambda _: utils.get_clipboard(),
'primary': lambda _: utils.get_clipboard(selection=True),

View File

@ -3716,8 +3716,8 @@ bindings.default:
yD: yank domain -s
yp: yank pretty-url
yP: yank pretty-url -s
ym: yank inline [{title}]({yank_url})
yM: yank inline [{title}]({yank_url}) -s
ym: yank inline [{title}]({url:yank})
yM: yank inline [{title}]({url:yank}) -s
pp: open -- {clipboard}
pP: open -- {primary}
Pp: open -t -- {clipboard}

View File

@ -41,7 +41,7 @@ Feature: Yanking and pasting.
Scenario: Yanking inline to clipboard
When I open data/title.html
And I run :yank inline '[[{yank_url}][qutebrowser</3org]]'
And I run :yank inline '[[{url:yank}][qutebrowser</3org]]'
Then the message "Yanked inline block to clipboard: [[http://localhost:(port)/data/title.html][qutebrowser</3org]]" should be shown
And the clipboard should contain "[[http://localhost:(port)/data/title.html][qutebrowser</3org]]"

View File

@ -39,7 +39,7 @@ def test_command_expansion(quteproc, send_msg, recv_msg):
@pytest.mark.parametrize('send_msg, recv_msg, url', [
('foo{title}', 'fooTest title', 'data/title.html'),
('foo{url:query}', 'fooq=bar', 'data/hello.txt?q=bar'),
('foo{yank_url}', 'foohttp://localhost:*/hello.txt', 'data/hello.txt?ref=test'),
('foo{url:yank}', 'foohttp://localhost:*/hello.txt', 'data/hello.txt?ref=test'),
# multiple variable expansion
('{title}bar{url}', 'Test titlebarhttp://localhost:*/title.html', 'data/title.html'),