Rename :follow-hint to :hint-follow

See #6022
This commit is contained in:
Florian Bruhin 2021-01-20 18:10:13 +01:00
parent c4c3702089
commit fc87c3df0f
12 changed files with 38 additions and 37 deletions

View File

@ -185,6 +185,7 @@ Changed
* `drop-selection` -> `selection-drop`
* `reverse-selection` -> `selection-reverse`
* `follow-selected` -> `selection-follow`
* `follow-hint` -> `hint-follow`
- Various performance improvements, including for the startup time.
Fixed

View File

@ -1601,7 +1601,7 @@ How many steps to zoom out.
|<<completion-item-del,completion-item-del>>|Delete the current completion item.
|<<completion-item-focus,completion-item-focus>>|Shift the focus of the completion menu to another item.
|<<completion-item-yank,completion-item-yank>>|Yank the current completion item into the clipboard.
|<<follow-hint,follow-hint>>|Follow a hint.
|<<hint-follow,hint-follow>>|Follow a hint.
|<<leave-mode,leave-mode>>|Leave the mode we're currently in.
|<<move-to-end-of-document,move-to-end-of-document>>|Move the cursor or selection to the end of the document.
|<<move-to-end-of-line,move-to-end-of-line>>|Move the cursor or selection to the end of line.
@ -1685,9 +1685,9 @@ Yank the current completion item into the clipboard.
==== optional arguments
* +*-s*+, +*--sel*+: Use the primary selection instead of the clipboard.
[[follow-hint]]
=== follow-hint
Syntax: +:follow-hint [*--select*] ['keystring']+
[[hint-follow]]
=== hint-follow
Syntax: +:hint-follow [*--select*] ['keystring']+
Follow a hint.

View File

@ -529,7 +529,7 @@ Default:
* +pass:[&lt;Ctrl-F&gt;]+: +pass:[hint links]+
* +pass:[&lt;Ctrl-R&gt;]+: +pass:[hint --rapid links tab-bg]+
* +pass:[&lt;Escape&gt;]+: +pass:[leave-mode]+
* +pass:[&lt;Return&gt;]+: +pass:[follow-hint]+
* +pass:[&lt;Return&gt;]+: +pass:[hint-follow]+
- +pass:[insert]+:
* +pass:[&lt;Ctrl-E&gt;]+: +pass:[edit-text]+

View File

@ -838,7 +838,7 @@ class HintManager(QObject):
else:
follow = False
# save the keystr of the only one visible hint to be picked up
# later by self.follow_hint
# later by self.hint_follow
self._context.to_follow = list(visible.keys())[0]
if follow:
@ -1001,7 +1001,7 @@ class HintManager(QObject):
@cmdutils.register(instance='hintmanager', scope='window',
modes=[usertypes.KeyMode.hint])
def follow_hint(self, select: bool = False, keystring: str = None) -> None:
def hint_follow(self, select: bool = False, keystring: str = None) -> None:
"""Follow a hint.
Args:

View File

@ -3393,7 +3393,7 @@ bindings.default:
<Shift-Ins>: insert-text -- {primary}
<Escape>: leave-mode
hint:
<Return>: follow-hint
<Return>: hint-follow
<Ctrl-R>: hint --rapid links tab-bg
<Ctrl-F>: hint links
<Ctrl-B>: hint all tab-bg

View File

@ -381,7 +381,7 @@ def hint_and_follow(quteproc, args, letter):
args = args.replace('(python-executable)', sys.executable)
quteproc.send_cmd(':hint {}'.format(args))
quteproc.wait_for(message='hints: *')
quteproc.send_cmd(':follow-hint {}'.format(letter))
quteproc.send_cmd(':hint-follow {}'.format(letter))
@bdd.when("I wait until the scroll position changed")

View File

@ -48,7 +48,7 @@ Feature: Downloading things from a website.
When I set downloads.location.prompt to true
And I open data/downloads/downloads.html
And I hint with args "--rapid links download" and follow a
And I run :follow-hint s
And I run :hint-follow s
And I wait until the download download.bin is finished
And I wait until the download download2.bin is finished
Then the downloaded file download.bin should exist
@ -667,7 +667,7 @@ Feature: Downloading things from a website.
Scenario: user-agent when using hints
When I open /
And I run :hint links download
And I run :follow-hint a
And I run :hint-follow a
And I wait until the download is finished
Then the downloaded file user-agent should contain Safari/

View File

@ -6,11 +6,11 @@ Feature: Using hints
Background:
Given I clean up open tabs
Scenario: Using :follow-hint outside of hint mode (issue 1105)
When I run :follow-hint
Then the error "follow-hint: This command is only allowed in hint mode, not normal." should be shown
Scenario: Using :hint-follow outside of hint mode (issue 1105)
When I run :hint-follow
Then the error "hint-follow: This command is only allowed in hint mode, not normal." should be shown
Scenario: Using :follow-hint with an invalid index.
Scenario: Using :hint-follow with an invalid index.
When I open data/hints/html/simple.html
And I hint with args "links normal" and follow xyz
Then the error "No hint xyz!" should be shown
@ -26,8 +26,8 @@ Feature: Using hints
And I wait for regex "hints: .*|Current tab changed \(\d* -> \d*\) before _start_cb is run\." in the log
# 'hints: .*' is logged when _start_cb is called before tab-prev (on
# qtwebkit, _start_cb is called synchronously)
And I run :follow-hint a
Then the error "follow-hint: This command is only allowed in hint mode, not normal." should be shown
And I run :hint-follow a
Then the error "hint-follow: This command is only allowed in hint mode, not normal." should be shown
### Opening in current or new tab
@ -138,8 +138,8 @@ Feature: Using hints
When I run :debug-set-fake-clipboard
And I open data/hints/rapid.html
And I hint with args "links yank --rapid"
And I run :follow-hint a
And I run :follow-hint s
And I run :hint-follow a
And I run :hint-follow s
And I run :leave-mode
Then the clipboard should contain "http://localhost:(port)/data/hello.txt(linesep)http://localhost:(port)/data/hello2.txt"
@ -147,8 +147,8 @@ Feature: Using hints
When I open data/hints/rapid.html in a new tab
And I run :tab-only
And I hint with args "all tab-bg --rapid"
And I run :follow-hint a
And I run :follow-hint s
And I run :hint-follow a
And I run :hint-follow s
And I run :leave-mode
And I wait until data/hello.txt is loaded
And I wait until data/hello2.txt is loaded
@ -167,9 +167,9 @@ Feature: Using hints
Scenario: Using hint --rapid to hit multiple buttons
When I open data/hints/buttons.html
And I hint with args "--rapid"
And I run :follow-hint s
And I run :follow-hint d
And I run :follow-hint f
And I run :hint-follow s
And I run :hint-follow d
And I run :hint-follow f
Then the javascript message "beep!" should be logged
And the javascript message "bop!" should be logged
And the javascript message "boop!" should be logged
@ -254,12 +254,12 @@ Feature: Using hints
Then the javascript message "contents: existingnew" should be logged
### iframes
Scenario: Using :follow-hint inside an iframe
Scenario: Using :hint-follow inside an iframe
When I open data/hints/iframe.html
And I hint with args "links normal" and follow a
Then "navigation request: url http://localhost:*/data/hello.txt, type Type.link_clicked, *" should be logged
Scenario: Using :follow-hint inside an iframe button
Scenario: Using :hint-follow inside an iframe button
When I open data/hints/iframe_button.html
And I hint with args "all normal" and follow s
Then "navigation request: url http://localhost:*/data/hello.txt, *" should be logged
@ -273,7 +273,7 @@ Feature: Using hints
Then no crash should happen
@flaky # FIXME https://github.com/qutebrowser/qutebrowser/issues/1525
Scenario: Using :follow-hint inside a scrolled iframe
Scenario: Using :hint-follow inside a scrolled iframe
When I open data/hints/iframe_scroll.html
And I hint with args "all normal" and follow a
And I run :scroll bottom
@ -360,7 +360,7 @@ Feature: Using hints
And I hint with args "all"
And I press the key "s"
And I wait for "Filtering hints on 's'" in the log
And I run :follow-hint 1
And I run :hint-follow 1
Then data/numbers/7.txt should be loaded
# https://github.com/qutebrowser/qutebrowser/issues/576
@ -370,8 +370,8 @@ Feature: Using hints
And I set hints.mode to number
And I hint with args "all tab-bg --rapid"
And I press the key "t"
And I run :follow-hint 0
And I run :follow-hint 1
And I run :hint-follow 0
And I run :hint-follow 1
Then data/numbers/2.txt should be loaded
And data/numbers/3.txt should be loaded
@ -383,7 +383,7 @@ Feature: Using hints
And I press the key "x"
And I press the key "0"
And I press the key "<Backspace>"
And I run :follow-hint 11
And I run :hint-follow 11
Then the error "No hint 11!" should be shown
# https://github.com/qutebrowser/qutebrowser/issues/674#issuecomment-165096744
@ -438,7 +438,7 @@ Feature: Using hints
And I hint with args "--mode number all"
And I press the key "s"
And I wait for "Filtering hints on 's'" in the log
And I run :follow-hint 1
And I run :hint-follow 1
Then data/numbers/7.txt should be loaded
### hints.leave_on_load

View File

@ -141,7 +141,7 @@ Feature: Miscellaneous utility commands exposed to the user.
And I run :leave-mode
And I run :repeat-command
And I wait for "hints: *" in the log
And I run :follow-hint a
And I run :hint-follow a
And I wait until data/hello.txt is loaded
Then the following tabs should be open:
- data/hints/link_blank.html

View File

@ -193,7 +193,7 @@ def test_enter_folder_smoke(dir_layout, quteproc):
quteproc.open_url(dir_layout.file_url())
quteproc.send_cmd(':hint all normal')
# a is the parent link, s is the first listed folder/file
quteproc.send_cmd(':follow-hint s')
quteproc.send_cmd(':hint-follow s')
expected_url = urlutils.file_url(dir_layout.path('folder0'))
quteproc.wait_for_load_finished_url(expected_url)
page = parse(quteproc)

View File

@ -111,7 +111,7 @@ def test_hints(test_name, zoom_text_only, zoom_level, find_implementation,
# follow hint
quteproc.send_cmd(':hint all normal')
quteproc.wait_for(message='hints: a', category='hints')
quteproc.send_cmd(':follow-hint a')
quteproc.send_cmd(':hint-follow a')
quteproc.wait_for_load_finished('data/' + parsed.target)
# reset
quteproc.send_cmd(':zoom 100')
@ -148,5 +148,5 @@ def test_word_hints_issue1393(quteproc, tmpdir):
quteproc.open_path('data/hints/issue1393.html')
quteproc.send_cmd(':hint')
quteproc.wait_for(message='hints: *', category='hints')
quteproc.send_cmd(':follow-hint {}'.format(hint))
quteproc.send_cmd(':hint-follow {}'.format(hint))
quteproc.wait_for_load_finished('data/{}'.format(target))

View File

@ -85,7 +85,7 @@ def test_auto_leave_insert_mode(quteproc):
quteproc.wait_for(message='hints: *')
# Select the disabled input box to leave insert mode
quteproc.send_cmd(':follow-hint s')
quteproc.send_cmd(':hint-follow s')
quteproc.wait_for(message='Clicked non-editable element!')