diff options
author | Philipp Albrecht <palbrecht@mailbox.org> | 2023-08-02 13:11:42 +0200 |
---|---|---|
committer | Philipp Albrecht <palbrecht@mailbox.org> | 2023-08-11 09:02:12 +0200 |
commit | 86925b58cbe101f1ba2c6184eefd67c0c2844641 (patch) | |
tree | 594ac08484ee9458f691202d5f27ab4c6d0ce157 | |
parent | f354d3ab91efdbfcf72a3b75b0f221f8539d98eb (diff) | |
download | qutebrowser-86925b58cbe101f1ba2c6184eefd67c0c2844641.tar.gz qutebrowser-86925b58cbe101f1ba2c6184eefd67c0c2844641.zip |
Rename :repeat-command to :cmd-repeat-last
Group commands related to commands/commandline by prefixing them with `cmd-`. In this
case we additionally renamed the command slightly to fit better with the `cmd-` prefix.
-rw-r--r-- | doc/help/commands.asciidoc | 16 | ||||
-rw-r--r-- | qutebrowser/misc/utilcmds.py | 4 | ||||
-rw-r--r-- | tests/end2end/features/utilcmds.feature | 18 | ||||
-rw-r--r-- | tests/unit/misc/test_utilcmds.py | 6 |
4 files changed, 22 insertions, 22 deletions
diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index d0ed53002..5fb9672e5 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -42,6 +42,7 @@ possible to run or bind multiple commands by separating them with `;;`. |<<close,close>>|Close the current window. |<<cmd-later,cmd-later>>|Execute a command after some time. |<<cmd-repeat,cmd-repeat>>|Repeat a given command. +|<<cmd-repeat-last,cmd-repeat-last>>|Repeat the last executed command. |<<cmd-run-with-count,cmd-run-with-count>>|Run a command with the given count. |<<cmd-set-text,cmd-set-text>>|Preset the statusbar to some text. |<<config-clear,config-clear>>|Set all settings back to their default. @@ -97,7 +98,6 @@ possible to run or bind multiple commands by separating them with `;;`. |<<quickmark-save,quickmark-save>>|Save the current page as a quickmark. |<<quit,quit>>|Quit qutebrowser. |<<reload,reload>>|Reload the current/[count]th tab. -|<<repeat-command,repeat-command>>|Repeat the last executed command. |<<report,report>>|Report a bug in qutebrowser. |<<restart,restart>>|Restart qutebrowser while keeping existing tabs open. |<<save,save>>|Save configs and state. @@ -314,6 +314,13 @@ Multiplies with 'times' when given. * With this command, +;;+ is interpreted literally instead of splitting off a second command. * This command does not replace variables like +\{url\}+. +[[cmd-repeat-last]] +=== cmd-repeat-last +Repeat the last executed command. + +==== count +Which count to pass the command. + [[cmd-run-with-count]] === cmd-run-with-count Syntax: +:cmd-run-with-count 'count-arg' 'command'+ @@ -1115,13 +1122,6 @@ Reload the current/[count]th tab. ==== count The tab index to reload. -[[repeat-command]] -=== repeat-command -Repeat the last executed command. - -==== count -Which count to pass the command. - [[report]] === report Syntax: +:report ['info'] ['contact']+ diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 258cc437d..6689ad074 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -187,10 +187,10 @@ def debug_set_fake_clipboard(s: str = None) -> None: utils.fake_clipboard = s -@cmdutils.register() +@cmdutils.register(deprecated_name='repeat-command') @cmdutils.argument('win_id', value=cmdutils.Value.win_id) @cmdutils.argument('count', value=cmdutils.Value.count) -def repeat_command(win_id: int, count: int = None) -> None: +def cmd_repeat_last(win_id: int, count: int = None) -> None: """Repeat the last executed command. Args: diff --git a/tests/end2end/features/utilcmds.feature b/tests/end2end/features/utilcmds.feature index c603c7165..1b5306adb 100644 --- a/tests/end2end/features/utilcmds.feature +++ b/tests/end2end/features/utilcmds.feature @@ -110,35 +110,35 @@ Feature: Miscellaneous utility commands exposed to the user. And "hiding debug console" should be logged And no crash should happen - ## :repeat-command + ## :cmd-repeat-last - Scenario: :repeat-command + Scenario: :cmd-repeat-last When I run :message-info test1 - And I run :repeat-command + And I run :cmd-repeat-last Then the message "test1" should be shown And the message "test1" should be shown - Scenario: :repeat-command with count + Scenario: :cmd-repeat-last with count When I run :message-info test2 - And I run :repeat-command with count 2 + And I run :cmd-repeat-last with count 2 Then the message "test2" should be shown And the message "test2" should be shown And the message "test2" should be shown - Scenario: :repeat-command with not-normal command in between + Scenario: :cmd-repeat-last with not-normal command in between When I run :message-info test3 And I run :prompt-accept - And I run :repeat-command + And I run :cmd-repeat-last Then the message "test3" should be shown And the error "prompt-accept: This command is only allowed in prompt/yesno mode, not normal." should be shown And the error "prompt-accept: This command is only allowed in prompt/yesno mode, not normal." should be shown - Scenario: :repeat-command with mode-switching command + Scenario: :cmd-repeat-last with mode-switching command When I open data/hints/link_blank.html And I run :tab-only And I hint with args "all tab-fg" And I run :mode-leave - And I run :repeat-command + And I run :cmd-repeat-last And I wait for "hints: *" in the log And I run :hint-follow a And I wait until data/hello.txt is loaded diff --git a/tests/unit/misc/test_utilcmds.py b/tests/unit/misc/test_utilcmds.py index 674f046c7..96bc8da42 100644 --- a/tests/unit/misc/test_utilcmds.py +++ b/tests/unit/misc/test_utilcmds.py @@ -12,17 +12,17 @@ from qutebrowser.api import cmdutils from qutebrowser.utils import objreg -def test_repeat_command_initial(mocker, mode_manager): +def test_cmd_repeat_last_initial(mocker, mode_manager): """Test repeat_command first-time behavior. - If :repeat-command is called initially, it should err, because there's + If :cmd-repeat-last is called initially, it should err, because there's nothing to repeat. """ objreg_mock = mocker.patch('qutebrowser.misc.utilcmds.objreg') objreg_mock.get.return_value = mode_manager with pytest.raises(cmdutils.CommandError, match="You didn't do anything yet."): - utilcmds.repeat_command(win_id=0) + utilcmds.cmd_repeat_last(win_id=0) class FakeWindow: |