summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Albrecht <palbrecht@mailbox.org>2023-08-02 13:13:13 +0200
committerPhilipp Albrecht <palbrecht@mailbox.org>2023-08-11 09:02:17 +0200
commitd5faeef14caef3e9fed7c0dec338addb4bb5aac6 (patch)
tree234212769621c3247d46e39184bd348a69304d7b
parent86925b58cbe101f1ba2c6184eefd67c0c2844641 (diff)
downloadqutebrowser-d5faeef14caef3e9fed7c0dec338addb4bb5aac6.tar.gz
qutebrowser-d5faeef14caef3e9fed7c0dec338addb4bb5aac6.zip
Rename :edit-command to :cmd-edit
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.asciidoc20
-rw-r--r--qutebrowser/mainwindow/statusbar/command.py5
-rw-r--r--tests/end2end/features/editor.feature8
3 files changed, 17 insertions, 16 deletions
diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc
index 5fb9672e5..d35d01079 100644
--- a/doc/help/commands.asciidoc
+++ b/doc/help/commands.asciidoc
@@ -40,6 +40,7 @@ possible to run or bind multiple commands by separating them with `;;`.
|<<clear-messages,clear-messages>>|Clear all message notifications.
|<<click-element,click-element>>|Click the element matching the given filter.
|<<close,close>>|Close the current window.
+|<<cmd-edit,cmd-edit>>|Open an editor to modify the current command.
|<<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.
@@ -65,7 +66,6 @@ possible to run or bind multiple commands by separating them with `;;`.
|<<download-open,download-open>>|Open the last/[count]th download.
|<<download-remove,download-remove>>|Remove the last/[count]th download from the list.
|<<download-retry,download-retry>>|Retry the first failed/[count]th download.
-|<<edit-command,edit-command>>|Open an editor to modify the current command.
|<<edit-text,edit-text>>|Open an external editor with the currently selected form field.
|<<edit-url,edit-url>>|Navigate to a url formed in an external editor.
|<<fake-key,fake-key>>|Send a fake keypress or key string to the website or qutebrowser.
@@ -281,6 +281,15 @@ The given filter needs to result in exactly one element, otherwise, an error is
=== close
Close the current window.
+[[cmd-edit]]
+=== cmd-edit
+Syntax: +:cmd-edit [*--run*]+
+
+Open an editor to modify the current command.
+
+==== optional arguments
+* +*-r*+, +*--run*+: Run the command if the editor exits successfully.
+
[[cmd-later]]
=== cmd-later
Syntax: +:cmd-later 'duration' 'command'+
@@ -593,15 +602,6 @@ Retry the first failed/[count]th download.
==== count
The index of the download to retry.
-[[edit-command]]
-=== edit-command
-Syntax: +:edit-command [*--run*]+
-
-Open an editor to modify the current command.
-
-==== optional arguments
-* +*-r*+, +*--run*+: Run the command if the editor exits successfully.
-
[[edit-text]]
=== edit-text
Open an external editor with the currently selected form field.
diff --git a/qutebrowser/mainwindow/statusbar/command.py b/qutebrowser/mainwindow/statusbar/command.py
index 3ee6692b3..988eed4a0 100644
--- a/qutebrowser/mainwindow/statusbar/command.py
+++ b/qutebrowser/mainwindow/statusbar/command.py
@@ -197,8 +197,9 @@ class Command(misc.CommandLineEdit):
if not was_search:
self.got_cmd[str].emit(text[1:])
- @cmdutils.register(instance='status-command', scope='window')
- def edit_command(self, run: bool = False) -> None:
+ @cmdutils.register(instance='status-command', scope='window',
+ deprecated_name='edit-command')
+ def cmd_edit(self, run: bool = False) -> None:
"""Open an editor to modify the current command.
Args:
diff --git a/tests/end2end/features/editor.feature b/tests/end2end/features/editor.feature
index 1ca540520..9ca855d27 100644
--- a/tests/end2end/features/editor.feature
+++ b/tests/end2end/features/editor.feature
@@ -167,25 +167,25 @@ Feature: Opening external editors
And I wait for "Read back: bar" in the log
Then the javascript message "text: bar" should be logged
- ## :edit-command
+ ## :cmd-edit
Scenario: Edit a command and run it
When I run :cmd-set-text :message-info foo
And I setup a fake editor replacing "foo" by "bar"
- And I run :edit-command --run
+ And I run :cmd-edit --run
Then the message "bar" should be shown
And "Leaving mode KeyMode.command (reason: cmd accept)" should be logged
Scenario: Edit a command and omit the start char
When I setup a fake editor returning "message-info foo"
- And I run :edit-command
+ And I run :cmd-edit
Then the error "command must start with one of :/?" should be shown
And "Leaving mode KeyMode.command *" should not be logged
Scenario: Edit a command to be empty
When I run :cmd-set-text :
When I setup a fake editor returning empty text
- And I run :edit-command
+ And I run :cmd-edit
Then the error "command must start with one of :/?" should be shown
And "Leaving mode KeyMode.command *" should not be logged