diff options
28 files changed, 122 insertions, 120 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 8a99529cc..947a3bc50 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -186,6 +186,8 @@ Changed * `reverse-selection` -> `selection-reverse` * `follow-selected` -> `selection-follow` * `follow-hint` -> `hint-follow` + * `enter-mode` -> `mode-enter` + * `leave-mode` -> `mode-leave` - Various performance improvements, including for the startup time. Fixed diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 0d77c369b..c1e9290ed 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -62,7 +62,6 @@ possible to run or bind multiple commands by separating them with `;;`. |<<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. -|<<enter-mode,enter-mode>>|Enter a key mode. |<<fake-key,fake-key>>|Send a fake keypress or key string to the website or qutebrowser. |<<forward,forward>>|Go forward in the history of the current tab. |<<fullscreen,fullscreen>>|Toggle fullscreen mode. @@ -82,6 +81,7 @@ possible to run or bind multiple commands by separating them with `;;`. |<<message-info,message-info>>|Show an info message in the statusbar. |<<message-warning,message-warning>>|Show a warning message in the statusbar. |<<messages,messages>>|Show a log of past messages. +|<<mode-enter,mode-enter>>|Enter a key mode. |<<navigate,navigate>>|Open typical prev/next links or navigate using the URL path. |<<nop,nop>>|Do nothing. |<<open,open>>|Open a URL in the current/[count]th tab. @@ -517,17 +517,6 @@ The editor which should be launched can be configured via the `editor.command` c * +*-r*+, +*--related*+: If opening a new tab, position the tab as related to the current one (like clicking on a link). -[[enter-mode]] -=== enter-mode -Syntax: +:enter-mode 'mode'+ - -Enter a key mode. - -==== positional arguments -* +'mode'+: The mode to enter. See `:help bindings.commands` for the available modes, but note that hint/command/yesno/prompt mode - can't be entered manually. - - [[fake-key]] === fake-key Syntax: +:fake-key [*--global*] 'keystring'+ @@ -846,6 +835,17 @@ Show a log of past messages. is negated. +[[mode-enter]] +=== mode-enter +Syntax: +:mode-enter 'mode'+ + +Enter a key mode. + +==== positional arguments +* +'mode'+: The mode to enter. See `:help bindings.commands` for the available modes, but note that hint/command/yesno/prompt mode + can't be entered manually. + + [[navigate]] === navigate Syntax: +:navigate [*--tab*] [*--bg*] [*--window*] 'where'+ @@ -1602,7 +1602,7 @@ How many steps to zoom out. |<<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. |<<hint-follow,hint-follow>>|Follow a hint. -|<<leave-mode,leave-mode>>|Leave the mode we're currently in. +|<<mode-leave,mode-leave>>|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. |<<move-to-end-of-next-block,move-to-end-of-next-block>>|Move the cursor or selection to the end of next block. @@ -1697,8 +1697,8 @@ Follow a hint. ==== optional arguments * +*-s*+, +*--select*+: Only select the given hint, don't necessarily follow it. -[[leave-mode]] -=== leave-mode +[[mode-leave]] +=== mode-leave Leave the mode we're currently in. [[move-to-end-of-document]] diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 4253a18ec..5562df390 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -464,7 +464,7 @@ Default: * +pass:[$]+: +pass:[move-to-end-of-line]+ * +pass:[0]+: +pass:[move-to-start-of-line]+ * +pass:[<Ctrl-Space>]+: +pass:[selection-drop]+ -* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Escape>]+: +pass:[mode-leave]+ * +pass:[<Return>]+: +pass:[yank selection]+ * +pass:[<Space>]+: +pass:[selection-toggle]+ * +pass:[G]+: +pass:[move-to-end-of-document]+ @@ -477,7 +477,7 @@ Default: * +pass:[[]+: +pass:[move-to-start-of-prev-block]+ * +pass:[]]+: +pass:[move-to-start-of-next-block]+ * +pass:[b]+: +pass:[move-to-prev-word]+ -* +pass:[c]+: +pass:[enter-mode normal]+ +* +pass:[c]+: +pass:[mode-enter normal]+ * +pass:[e]+: +pass:[move-to-end-of-word]+ * +pass:[gg]+: +pass:[move-to-start-of-document]+ * +pass:[h]+: +pass:[move-to-prev-char]+ @@ -515,7 +515,7 @@ Default: * +pass:[<Ctrl-W>]+: +pass:[rl-unix-word-rubout]+ * +pass:[<Ctrl-Y>]+: +pass:[rl-yank]+ * +pass:[<Down>]+: +pass:[completion-item-focus --history next]+ -* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Escape>]+: +pass:[mode-leave]+ * +pass:[<PgDown>]+: +pass:[completion-item-focus next-page]+ * +pass:[<PgUp>]+: +pass:[completion-item-focus prev-page]+ * +pass:[<Return>]+: +pass:[command-accept]+ @@ -528,16 +528,16 @@ Default: * +pass:[<Ctrl-B>]+: +pass:[hint all tab-bg]+ * +pass:[<Ctrl-F>]+: +pass:[hint links]+ * +pass:[<Ctrl-R>]+: +pass:[hint --rapid links tab-bg]+ -* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Escape>]+: +pass:[mode-leave]+ * +pass:[<Return>]+: +pass:[hint-follow]+ - +pass:[insert]+: * +pass:[<Ctrl-E>]+: +pass:[edit-text]+ -* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Escape>]+: +pass:[mode-leave]+ * +pass:[<Shift-Ins>]+: +pass:[insert-text -- {primary}]+ - +pass:[normal]+: -* +pass:[']+: +pass:[enter-mode jump_mark]+ +* +pass:[']+: +pass:[mode-enter jump_mark]+ * +pass:[+]+: +pass:[zoom-in]+ * +pass:[-]+: +pass:[zoom-out]+ * +pass:[.]+: +pass:[repeat-command]+ @@ -584,7 +584,7 @@ Default: * +pass:[<Ctrl-T>]+: +pass:[open -t]+ * +pass:[<Ctrl-Tab>]+: +pass:[tab-focus last]+ * +pass:[<Ctrl-U>]+: +pass:[scroll-page 0 -0.5]+ -* +pass:[<Ctrl-V>]+: +pass:[enter-mode passthrough]+ +* +pass:[<Ctrl-V>]+: +pass:[mode-enter passthrough]+ * +pass:[<Ctrl-W>]+: +pass:[tab-close]+ * +pass:[<Ctrl-X>]+: +pass:[navigate decrement]+ * +pass:[<Ctrl-^>]+: +pass:[tab-focus last]+ @@ -620,12 +620,12 @@ Default: * +pass:[Ss]+: +pass:[open qute://settings]+ * +pass:[T]+: +pass:[tab-focus]+ * +pass:[U]+: +pass:[undo -w]+ -* +pass:[V]+: +pass:[enter-mode caret ;; selection-toggle --line]+ +* +pass:[V]+: +pass:[mode-enter caret ;; selection-toggle --line]+ * +pass:[ZQ]+: +pass:[quit]+ * +pass:[ZZ]+: +pass:[quit --save]+ * +pass:[[[]+: +pass:[navigate prev]+ * +pass:[]]]+: +pass:[navigate next]+ -* +pass:[`]+: +pass:[enter-mode set_mark]+ +* +pass:[`]+: +pass:[mode-enter set_mark]+ * +pass:[ad]+: +pass:[download-cancel]+ * +pass:[b]+: +pass:[set-cmd-text -s :quickmark-load]+ * +pass:[cd]+: +pass:[download-clear]+ @@ -653,7 +653,7 @@ Default: * +pass:[gt]+: +pass:[set-cmd-text -s :tab-select]+ * +pass:[gu]+: +pass:[navigate up]+ * +pass:[h]+: +pass:[scroll left]+ -* +pass:[i]+: +pass:[enter-mode insert]+ +* +pass:[i]+: +pass:[mode-enter insert]+ * +pass:[j]+: +pass:[scroll down]+ * +pass:[k]+: +pass:[scroll up]+ * +pass:[l]+: +pass:[scroll right]+ @@ -695,7 +695,7 @@ Default: * +pass:[tsh]+: +pass:[config-cycle -p -t -u *://{url:host}/* content.javascript.enabled ;; reload]+ * +pass:[tsu]+: +pass:[config-cycle -p -t -u {url} content.javascript.enabled ;; reload]+ * +pass:[u]+: +pass:[undo]+ -* +pass:[v]+: +pass:[enter-mode caret]+ +* +pass:[v]+: +pass:[mode-enter caret]+ * +pass:[wB]+: +pass:[set-cmd-text -s :bookmark-load -w]+ * +pass:[wIf]+: +pass:[devtools-focus]+ * +pass:[wIh]+: +pass:[devtools left]+ @@ -728,7 +728,7 @@ Default: * +pass:[}}]+: +pass:[navigate next -t]+ - +pass:[passthrough]+: -* +pass:[<Shift-Escape>]+: +pass:[leave-mode]+ +* +pass:[<Shift-Escape>]+: +pass:[mode-leave]+ - +pass:[prompt]+: * +pass:[<Alt-B>]+: +pass:[rl-backward-word]+ @@ -750,19 +750,19 @@ Default: * +pass:[<Ctrl-X>]+: +pass:[prompt-open-download]+ * +pass:[<Ctrl-Y>]+: +pass:[rl-yank]+ * +pass:[<Down>]+: +pass:[prompt-item-focus next]+ -* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Escape>]+: +pass:[mode-leave]+ * +pass:[<Return>]+: +pass:[prompt-accept]+ * +pass:[<Shift-Tab>]+: +pass:[prompt-item-focus prev]+ * +pass:[<Tab>]+: +pass:[prompt-item-focus next]+ * +pass:[<Up>]+: +pass:[prompt-item-focus prev]+ - +pass:[register]+: -* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Escape>]+: +pass:[mode-leave]+ - +pass:[yesno]+: * +pass:[<Alt-Shift-Y>]+: +pass:[prompt-yank --sel]+ * +pass:[<Alt-Y>]+: +pass:[prompt-yank]+ -* +pass:[<Escape>]+: +pass:[leave-mode]+ +* +pass:[<Escape>]+: +pass:[mode-leave]+ * +pass:[<Return>]+: +pass:[prompt-accept]+ * +pass:[N]+: +pass:[prompt-accept --save no]+ * +pass:[Y]+: +pass:[prompt-accept --save yes]+ diff --git a/misc/userscripts/qute-bitwarden b/misc/userscripts/qute-bitwarden index ca9d646e4..a4954ef0c 100755 --- a/misc/userscripts/qute-bitwarden +++ b/misc/userscripts/qute-bitwarden @@ -278,7 +278,7 @@ def main(arguments): fake_key_raw(password) if arguments.insert_mode: - qute_command('enter-mode insert') + qute_command('mode-enter insert') # If it finds a TOTP code, it copies it to the clipboard, # which is the same behavior as the Firefox add-on. diff --git a/misc/userscripts/qute-keepass b/misc/userscripts/qute-keepass index ae2da2340..0af669c9f 100755 --- a/misc/userscripts/qute-keepass +++ b/misc/userscripts/qute-keepass @@ -235,7 +235,7 @@ def run(args): username, password = candidate_to_secret(selection) - insert_mode = ';; enter-mode insert' if args.insert_mode else '' + insert_mode = ';; mode-enter insert' if args.insert_mode else '' if args.username_fill_only: qute_command('insert-text {}{}'.format(username, insert_mode)) elif args.password_fill_only: diff --git a/misc/userscripts/qute-lastpass b/misc/userscripts/qute-lastpass index c92505600..503b19512 100755 --- a/misc/userscripts/qute-lastpass +++ b/misc/userscripts/qute-lastpass @@ -173,7 +173,7 @@ def main(arguments): fake_key_raw(password) if arguments.insert_mode: - qute_command('enter-mode insert') + qute_command('mode-enter insert') return ExitCodes.SUCCESS diff --git a/misc/userscripts/qute-pass b/misc/userscripts/qute-pass index 388a7a737..9ea2bb5ac 100755 --- a/misc/userscripts/qute-pass +++ b/misc/userscripts/qute-pass @@ -247,7 +247,7 @@ def main(arguments): fake_key_raw(password) if arguments.insert_mode: - qute_command('enter-mode insert') + qute_command('mode-enter insert') return ExitCodes.SUCCESS diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 1a1f84e56..0f7ba65ca 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -3260,11 +3260,11 @@ bindings.default: G: scroll-to-perc n: search-next N: search-prev - i: enter-mode insert - v: enter-mode caret - V: enter-mode caret ;; selection-toggle --line - "`": enter-mode set_mark - "'": enter-mode jump_mark + i: mode-enter insert + v: mode-enter caret + V: mode-enter caret ;; selection-toggle --line + "`": mode-enter set_mark + "'": mode-enter jump_mark yy: yank yY: yank -s yt: yank title @@ -3319,7 +3319,7 @@ bindings.default: <Ctrl-Tab>: tab-focus last <Ctrl-Shift-Tab>: nop <Ctrl-^>: tab-focus last - <Ctrl-V>: enter-mode passthrough + <Ctrl-V>: mode-enter passthrough <Ctrl-Q>: quit ZQ: quit ZZ: quit --save @@ -3391,15 +3391,15 @@ bindings.default: insert: <Ctrl-E>: edit-text <Shift-Ins>: insert-text -- {primary} - <Escape>: leave-mode + <Escape>: mode-leave hint: <Return>: hint-follow <Ctrl-R>: hint --rapid links tab-bg <Ctrl-F>: hint links <Ctrl-B>: hint all tab-bg - <Escape>: leave-mode + <Escape>: mode-leave passthrough: - <Shift-Escape>: leave-mode + <Shift-Escape>: mode-leave command: <Ctrl-P>: command-history-prev <Ctrl-N>: command-history-next @@ -3431,7 +3431,7 @@ bindings.default: <Ctrl-Y>: rl-yank <Ctrl-?>: rl-delete-char <Ctrl-H>: rl-backward-delete-char - <Escape>: leave-mode + <Escape>: mode-leave prompt: <Return>: prompt-accept <Ctrl-X>: prompt-open-download @@ -3456,7 +3456,7 @@ bindings.default: <Ctrl-?>: rl-delete-char <Ctrl-H>: rl-backward-delete-char <Ctrl-Y>: rl-yank - <Escape>: leave-mode + <Escape>: mode-leave yesno: <Return>: prompt-accept y: prompt-accept yes @@ -3465,13 +3465,13 @@ bindings.default: N: prompt-accept --save no <Alt-Y>: prompt-yank <Alt-Shift-Y>: prompt-yank --sel - <Escape>: leave-mode + <Escape>: mode-leave caret: v: selection-toggle V: selection-toggle --line <Space>: selection-toggle <Ctrl-Space>: selection-drop - c: enter-mode normal + c: mode-enter normal j: move-to-next-line k: move-to-prev-line l: move-to-next-char @@ -3495,9 +3495,9 @@ bindings.default: J: scroll down K: scroll up L: scroll right - <Escape>: leave-mode + <Escape>: mode-leave register: - <Escape>: leave-mode + <Escape>: mode-leave type: name: Dict none_ok: true diff --git a/qutebrowser/keyinput/modeman.py b/qutebrowser/keyinput/modeman.py index 4832e5769..149092ea8 100644 --- a/qutebrowser/keyinput/modeman.py +++ b/qutebrowser/keyinput/modeman.py @@ -386,7 +386,7 @@ class ModeManager(QObject): self.entered.emit(mode, self._win_id) @cmdutils.register(instance='mode-manager', scope='window') - def enter_mode(self, mode: str) -> None: + def mode_enter(self, mode: str) -> None: """Enter a key mode. Args: @@ -438,9 +438,9 @@ class ModeManager(QObject): self.enter(self._prev_mode, reason='restore mode before {}'.format(mode.name)) - @cmdutils.register(instance='mode-manager', name='leave-mode', + @cmdutils.register(instance='mode-manager', not_modes=[usertypes.KeyMode.normal], scope='window') - def leave_current_mode(self) -> None: + def mode_leave(self) -> None: """Leave the mode we're currently in.""" if self.mode == usertypes.KeyMode.normal: raise ValueError("Can't leave normal mode!") diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py index 9ca07b9ab..a30978ac9 100644 --- a/qutebrowser/mainwindow/prompt.py +++ b/qutebrowser/mainwindow/prompt.py @@ -601,7 +601,7 @@ class LineEditPrompt(_BasePrompt): return True def _allowed_commands(self): - return [('prompt-accept', 'Accept'), ('leave-mode', 'Abort')] + return [('prompt-accept', 'Accept'), ('mode-leave', 'Abort')] class FilenamePrompt(_BasePrompt): @@ -773,7 +773,7 @@ class FilenamePrompt(_BasePrompt): return idx def _allowed_commands(self): - return [('prompt-accept', 'Accept'), ('leave-mode', 'Abort')] + return [('prompt-accept', 'Accept'), ('mode-leave', 'Abort')] class DownloadFilenamePrompt(FilenamePrompt): @@ -805,7 +805,7 @@ class DownloadFilenamePrompt(FilenamePrompt): def _allowed_commands(self): cmds = [ ('prompt-accept', 'Accept'), - ('leave-mode', 'Abort'), + ('mode-leave', 'Abort'), ('prompt-open-download', "Open download"), ('prompt-open-download --pdfjs', "Open download via PDF.js"), ('prompt-yank', "Yank URL"), @@ -869,7 +869,7 @@ class AuthenticationPrompt(_BasePrompt): def _allowed_commands(self): return [('prompt-accept', "Accept"), - ('leave-mode', "Abort")] + ('mode-leave', "Abort")] class YesNoPrompt(_BasePrompt): @@ -931,7 +931,7 @@ class YesNoPrompt(_BasePrompt): default = 'yes' if self.question.default else 'no' cmds.append(('prompt-accept', "Use default ({})".format(default))) - cmds.append(('leave-mode', "Abort")) + cmds.append(('mode-leave', "Abort")) cmds.append(('prompt-yank', "Yank URL")) return cmds diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index ae9653d80..8050b7a4f 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -327,7 +327,7 @@ class StatusBar(QWidget): if mode == 'passthrough': key_instance = config.key_instance all_bindings = key_instance.get_reverse_bindings_for('passthrough') - bindings = all_bindings.get('leave-mode') + bindings = all_bindings.get('mode-leave') if bindings: suffix = ' ({} to leave)'.format(' or '.join(bindings)) else: diff --git a/tests/end2end/features/caret.feature b/tests/end2end/features/caret.feature index 3d6869768..c97d096ca 100644 --- a/tests/end2end/features/caret.feature +++ b/tests/end2end/features/caret.feature @@ -6,7 +6,7 @@ Feature: Caret mode Background: Given I open data/caret.html And I run :tab-only - And I also run :enter-mode caret + And I also run :mode-enter caret # :yank selection @@ -49,7 +49,7 @@ Feature: Caret mode Scenario: :selection-follow with --tab (with JS) When I set content.javascript.enabled to true And I run :tab-only - And I run :enter-mode caret + And I run :mode-enter caret And I run :selection-toggle And I run :move-to-end-of-word And I run :selection-follow --tab @@ -61,7 +61,7 @@ Feature: Caret mode Scenario: :selection-follow with --tab (without JS) When I set content.javascript.enabled to false And I run :tab-only - And I run :enter-mode caret + And I run :mode-enter caret And I run :selection-toggle And I run :move-to-end-of-word And I run :selection-follow --tab @@ -73,7 +73,7 @@ Feature: Caret mode @flaky Scenario: :selection-follow with link tabbing (without JS) When I set content.javascript.enabled to false - And I run :leave-mode + And I run :mode-leave And I run :jseval document.activeElement.blur(); And I run :fake-key <tab> And I run :selection-follow @@ -82,7 +82,7 @@ Feature: Caret mode @flaky Scenario: :selection-follow with link tabbing (with JS) When I set content.javascript.enabled to true - And I run :leave-mode + And I run :mode-leave And I run :jseval document.activeElement.blur(); And I run :fake-key <tab> And I run :selection-follow @@ -91,7 +91,7 @@ Feature: Caret mode @flaky Scenario: :selection-follow with link tabbing in a tab (without JS) When I set content.javascript.enabled to false - And I run :leave-mode + And I run :mode-leave And I run :jseval document.activeElement.blur(); And I run :fake-key <tab> And I run :selection-follow --tab @@ -100,7 +100,7 @@ Feature: Caret mode @flaky Scenario: :selection-follow with link tabbing in a tab (with JS) When I set content.javascript.enabled to true - And I run :leave-mode + And I run :mode-leave And I run :jseval document.activeElement.blur(); And I run :fake-key <tab> And I run :selection-follow --tab diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index eab4ae747..226e99ffa 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -89,7 +89,7 @@ Feature: Downloading things from a website. And I open data/data_link.html And I hint with args "links download" and follow s And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='download.pdf' mode=<PromptMode.download: 5> option=None text=* title='Save file to:'>, *" in the log - And I run :leave-mode + And I run :mode-leave Then no crash should happen Scenario: Aborting a download in a different window (issue 3378) @@ -98,7 +98,7 @@ Feature: Downloading things from a website. And I open data/downloads/download.bin in a new window without waiting And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> *" in the log And I run :window-only - And I run :leave-mode + And I run :mode-leave Then no crash should happen Scenario: Closing window with downloads.remove_finished timeout (issue 1242) @@ -166,7 +166,7 @@ Feature: Downloading things from a website. And I open data/downloads/download.bin without waiting And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> option=None text='Please enter a location for <b>http://localhost:*/data/downloads/download.bin</b>' title='Save file to:'>, *" in the log And I run :prompt-accept COM1 - And I run :leave-mode + And I run :mode-leave Then the error "Invalid filename" should be shown @windows @@ -175,7 +175,7 @@ Feature: Downloading things from a website. And I open data/downloads/download.bin without waiting And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> option=None text='Please enter a location for <b>http://localhost:*/data/downloads/download.bin</b>' title='Save file to:'>, *" in the log And I run :prompt-accept C:foobar - And I run :leave-mode + And I run :mode-leave Then the error "Invalid filename" should be shown @windows diff --git a/tests/end2end/features/editor.feature b/tests/end2end/features/editor.feature index 811e25c66..ad017ddb8 100644 --- a/tests/end2end/features/editor.feature +++ b/tests/end2end/features/editor.feature @@ -109,7 +109,7 @@ Feature: Opening external editors And I open data/editor.html And I run :click-element id qute-textarea And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log - And I run :leave-mode + And I run :mode-leave And I wait for "Leaving mode KeyMode.insert (reason: leave current)" in the log And I run :edit-text And I wait for "Read back: foobar" in the log @@ -149,13 +149,13 @@ Feature: Opening external editors And I open data/editor.html And I run :click-element id qute-textarea And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log - And I run :leave-mode + And I run :mode-leave And I wait for "Leaving mode KeyMode.insert (reason: leave current)" in the log - And I run :enter-mode caret + And I run :mode-enter caret And I wait for "Entering mode KeyMode.caret (reason: command)" in the log And I run :edit-text And I wait for "Read back: foobar" in the log - And I run :leave-mode + And I run :mode-leave Then the javascript message "text: foobar" should be logged Scenario: Spawning an editor with existing text diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index 234450c4c..a7b18b7f4 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -140,7 +140,7 @@ Feature: Using hints And I hint with args "links yank --rapid" And I run :hint-follow a And I run :hint-follow s - And I run :leave-mode + And I run :mode-leave Then the clipboard should contain "http://localhost:(port)/data/hello.txt(linesep)http://localhost:(port)/data/hello2.txt" Scenario: Rapid hinting @@ -149,7 +149,7 @@ Feature: Using hints And I hint with args "all tab-bg --rapid" And I run :hint-follow a And I run :hint-follow s - And I run :leave-mode + And I run :mode-leave And I wait until data/hello.txt is loaded And I wait until data/hello2.txt is loaded # We should check what the active tab is, but for some reason that makes @@ -183,7 +183,7 @@ Feature: Using hints When I open data/hints/input.html And I hint with args "inputs" and follow a And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log - And I run :leave-mode + And I run :mode-leave # The actual check is already done above Then no crash should happen @@ -223,7 +223,7 @@ Feature: Using hints When I open data/hints/input.html And I hint with args "inputs" and follow s And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log - And I run :leave-mode + And I run :mode-leave # The actual check is already done above Then no crash should happen @@ -231,7 +231,7 @@ Feature: Using hints When I open data/hints/ace/ace.html And I hint with args "inputs" and follow a And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log - And I run :leave-mode + And I run :mode-leave # The actual check is already done above Then no crash should happen @@ -268,7 +268,7 @@ Feature: Using hints When I open data/hints/iframe_input.html And I hint with args "inputs" and follow a And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log - And I run :leave-mode + And I run :mode-leave # The actual check is already done above Then no crash should happen @@ -417,7 +417,7 @@ Feature: Using hints When I open data/hints/number.html And I set hints.mode to number And I hint with args "--rapid" - And I run :leave-mode + And I run :mode-leave And I hint with args "--rapid" and follow 00 Then data/numbers/1.txt should be loaded @@ -599,14 +599,14 @@ Feature: Using hints And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log # ensure we clicked the first element And I run :jseval console.log(document.activeElement.id == "qute-input"); - And I run :leave-mode + And I run :mode-leave Then the javascript message "true" should be logged Scenario: Hinting contenteditable inputs When I open data/hints/input.html And I hint with args "inputs" and follow f And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log - And I run :leave-mode + And I run :mode-leave # The actual check is already done above Then no crash should happen @@ -618,7 +618,7 @@ Feature: Using hints Scenario: Statusbar text when entering hint mode from other mode When I open data/hints/html/simple.html - And I run :enter-mode insert + And I run :mode-enter insert And I hint with args "all" And I run :debug-pyeval objreg.get('main-window', window='current', scope='window').status.txt.text() # Changing tabs will leave hint mode diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index a079369fe..95d435267 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -177,5 +177,5 @@ Feature: Javascript stuff And I open data/hints/html/simple.html And I run :hint all And I wait for "hints: a" in the log - And I run :leave-mode + And I run :mode-leave Then "There was an error while getting hint elements" should not be logged diff --git a/tests/end2end/features/keyinput.feature b/tests/end2end/features/keyinput.feature index 2b86605f2..556914e4d 100644 --- a/tests/end2end/features/keyinput.feature +++ b/tests/end2end/features/keyinput.feature @@ -121,7 +121,7 @@ Feature: Keyboard input And I run :macro-record a And I run :hint links normal And I wait for "hints: *" in the log - And I run :leave-mode + And I run :mode-leave And I run :macro-record a And I run :macro-run And I press the key "a" @@ -150,7 +150,7 @@ Feature: Keyboard input Given I set tabs.mode_on_change to normal And I clean up open tabs When I open data/hello.txt - And I run :enter-mode insert + And I run :mode-enter insert And I wait for "Entering mode KeyMode.insert (reason: command)" in the log And I open data/hello2.txt in a new background tab And I run :tab-focus 2 @@ -162,7 +162,7 @@ Feature: Keyboard input Given I set tabs.mode_on_change to persist And I clean up open tabs When I open data/hello.txt - And I run :enter-mode insert + And I run :mode-enter insert And I wait for "Entering mode KeyMode.insert (reason: command)" in the log And I open data/hello2.txt in a new background tab And I run :tab-focus 2 @@ -174,13 +174,13 @@ Feature: Keyboard input Given I set tabs.mode_on_change to restore And I clean up open tabs When I open data/hello.txt - And I run :enter-mode insert + And I run :mode-enter insert And I wait for "Entering mode KeyMode.insert (reason: command)" in the log And I open data/hello2.txt in a new background tab And I run :tab-focus 2 And I wait for "Mode before tab change: insert (mode_on_change = restore)" in the log And I wait for "Mode after tab change: normal (mode_on_change = restore)" in the log - And I run :enter-mode passthrough + And I run :mode-enter passthrough And I wait for "Entering mode KeyMode.passthrough (reason: command)" in the log And I run :tab-focus 1 Then "Mode before tab change: passthrough (mode_on_change = restore)" should be logged diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index b8de93060..f2e098bc7 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -315,7 +315,7 @@ Feature: Various utility commands. And I wait for "Entering mode KeyMode.prompt *" in the log And I press the key "<Tab>" And I press the key "<Ctrl-C>" - And I run :leave-mode + And I run :mode-leave Then no crash should happen ## Custom headers @@ -504,10 +504,10 @@ Feature: Various utility commands. And I run :command-accept Then the error "No command given" should be shown - ## Modes blacklisted for :enter-mode + ## Modes blacklisted for :mode-enter - Scenario: Trying to enter command mode with :enter-mode - When I run :enter-mode command + Scenario: Trying to enter command mode with :mode-enter + When I run :mode-enter command Then the error "Mode command can't be entered manually!" should be shown ## Renderer crashes diff --git a/tests/end2end/features/private.feature b/tests/end2end/features/private.feature index 11b2dc0ab..fd8cf7062 100644 --- a/tests/end2end/features/private.feature +++ b/tests/end2end/features/private.feature @@ -214,7 +214,7 @@ Feature: Using private browsing And I open data/downloads/downloads.html in a private window And I run :click-element id download And I wait for "*PromptMode.download*" in the log - And I run :leave-mode + And I run :mode-leave Then "Removed download *: download.bin *" should be logged Scenario: Adblocking after reiniting private profile diff --git a/tests/end2end/features/prompts.feature b/tests/end2end/features/prompts.feature index 8562b50c4..f263615f5 100644 --- a/tests/end2end/features/prompts.feature +++ b/tests/end2end/features/prompts.feature @@ -36,7 +36,7 @@ Feature: Prompts When I open data/prompt/jsconfirm.html And I run :click-element id button And I wait for a prompt - And I run :leave-mode + And I run :mode-leave Then the javascript message "confirm reply: false" should be logged Scenario: Javascript prompt @@ -59,7 +59,7 @@ Feature: Prompts And I run :click-element id button And I wait for a prompt And I press the keys "prompt test" - And I run :leave-mode + And I run :mode-leave Then the javascript message "Prompt reply: null" should be logged # Multiple prompts @@ -199,7 +199,7 @@ Feature: Prompts And I set content.ssl_strict to ask And I load an SSL page And I wait for a prompt - And I run :leave-mode + And I run :mode-leave Then a SSL error page should be shown # Geolocation @@ -232,7 +232,7 @@ Feature: Prompts And I open data/prompt/geolocation.html in a new tab And I run :click-element id button And I wait for a prompt - And I run :leave-mode + And I run :mode-leave Then the javascript message "geolocation permission denied" should be logged # Notifications @@ -303,7 +303,7 @@ Feature: Prompts And I open data/prompt/notifications.html in a new tab And I run :click-element id button And I wait for a prompt - And I run :leave-mode + And I run :mode-leave Then the javascript message "notification permission aborted" should be logged @qtwebengine_notifications @@ -375,7 +375,7 @@ Feature: Prompts Scenario: Cancellling webpage authentication with QtWebKit When I open basic-auth/user6/password6 without waiting And I wait for a prompt - And I run :leave-mode + And I run :mode-leave Then basic-auth/user6/password6 should be loaded # :prompt-accept with value argument diff --git a/tests/end2end/features/qutescheme.feature b/tests/end2end/features/qutescheme.feature index 4c283710a..b1fee1603 100644 --- a/tests/end2end/features/qutescheme.feature +++ b/tests/end2end/features/qutescheme.feature @@ -193,7 +193,7 @@ Feature: Special qute:// pages And I wait for "[qute://pdfjs/*] PDF * (PDF.js: *)" in the log And I run :jseval document.getElementById("download").click() And I wait for "Asking question <qutebrowser.utils.usertypes.Question default=* mode=<PromptMode.download: 5> option=None text=* title='Save file to:'>, *" in the log - And I run :leave-mode + And I run :mode-leave Then no crash should happen # :pyeval diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 374b926e6..ca0efefc4 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -1590,10 +1590,10 @@ Feature: Tab management When I open data/hints/link_input.html And I run :click-element id qute-input-existing And I wait for "Entering mode KeyMode.insert *" in the log - And I run :leave-mode + And I run :mode-leave And I hint with args "all tab-bg" and follow a And I wait until data/hello.txt is loaded - And I run :enter-mode insert + And I run :mode-enter insert And I run :fake-key -g new Then the javascript message "contents: existingnew" should be logged @@ -1601,9 +1601,9 @@ Feature: Tab management When I open data/hints/link_input.html And I run :click-element id qute-input-existing And I wait for "Entering mode KeyMode.insert *" in the log - And I run :leave-mode + And I run :mode-leave And I open data/hello.txt in a new background tab - And I run :enter-mode insert + And I run :mode-enter insert And I run :fake-key -g new Then the javascript message "contents: existingnew" should be logged diff --git a/tests/end2end/features/test_downloads_bdd.py b/tests/end2end/features/test_downloads_bdd.py index 1f27d2794..2e8ef3c85 100644 --- a/tests/end2end/features/test_downloads_bdd.py +++ b/tests/end2end/features/test_downloads_bdd.py @@ -127,7 +127,7 @@ def download_contents(filename, text, tmpdir): def download_prompt(tmpdir, quteproc, path): full_path = path.replace('(tmpdir)', str(tmpdir)).replace('/', os.sep) quteproc.wait_for(message=PROMPT_MSG.format(full_path)) - quteproc.send_cmd(':leave-mode') + quteproc.send_cmd(':mode-leave') @bdd.when("I set a test python open_dispatcher") diff --git a/tests/end2end/features/utilcmds.feature b/tests/end2end/features/utilcmds.feature index 5dc5c730b..bb2b3e2fb 100644 --- a/tests/end2end/features/utilcmds.feature +++ b/tests/end2end/features/utilcmds.feature @@ -138,7 +138,7 @@ Feature: Miscellaneous utility commands exposed to the user. When I open data/hints/link_blank.html And I run :tab-only And I hint with args "all tab-fg" - And I run :leave-mode + And I run :mode-leave And I run :repeat-command And I wait for "hints: *" in the log And I run :hint-follow a @@ -172,7 +172,7 @@ Feature: Miscellaneous utility commands exposed to the user. Scenario: Using debug-log-filter When I run :debug-log-filter commands,ipc,webview - And I run :enter-mode insert + And I run :mode-enter insert And I run :debug-log-filter none - And I run :leave-mode + And I run :mode-leave Then "Entering mode KeyMode.insert *" should not be logged diff --git a/tests/end2end/features/yankpaste.feature b/tests/end2end/features/yankpaste.feature index a3264afa9..1ac5df507 100644 --- a/tests/end2end/features/yankpaste.feature +++ b/tests/end2end/features/yankpaste.feature @@ -315,7 +315,7 @@ Feature: Yanking and pasting. Scenario: Inserting text without a focused field When I open data/paste_primary.html - And I run :enter-mode insert + And I run :mode-enter insert And I run :insert-text test Then the error "No element focused!" should be shown @@ -323,6 +323,6 @@ Feature: Yanking and pasting. When I open data/paste_primary.html And I run :click-element id qute-textarea-noedit And I wait for "Clicked non-editable element!" in the log - And I run :enter-mode insert + And I run :mode-enter insert And I run :insert-text test Then the error "Element is not editable!" should be shown diff --git a/tests/end2end/test_insert_mode.py b/tests/end2end/test_insert_mode.py index 6bd616259..545fef3d1 100644 --- a/tests/end2end/test_insert_mode.py +++ b/tests/end2end/test_insert_mode.py @@ -50,7 +50,7 @@ def test_insert_mode(file_name, elem_id, source, input_text, zoom, raise ValueError("Invalid source {!r}".format(source)) quteproc.wait_for_js('contents: {}'.format(input_text)) - quteproc.send_cmd(':leave-mode') + quteproc.send_cmd(':mode-leave') @pytest.mark.parametrize('auto_load, background, insert_mode', [ @@ -67,7 +67,7 @@ def test_auto_load(quteproc, auto_load, background, insert_mode): log_message = 'Entering mode KeyMode.insert (reason: *)' if insert_mode: quteproc.wait_for(message=log_message) - quteproc.send_cmd(':leave-mode') + quteproc.send_cmd(':mode-leave') else: quteproc.ensure_not_logged(message=log_message) @@ -96,7 +96,7 @@ def test_auto_leave_insert_mode_reload(quteproc, leave_on_load): quteproc.set_setting('input.insert_mode.leave_on_load', str(leave_on_load).lower()) - quteproc.send_cmd(':enter-mode insert') + quteproc.send_cmd(':mode-enter insert') quteproc.wait_for(message='Entering mode KeyMode.insert (reason: *)') quteproc.send_cmd(':reload') if leave_on_load: diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py index 7de34a9a7..d0804d6e0 100644 --- a/tests/helpers/fixtures.py +++ b/tests/helpers/fixtures.py @@ -284,7 +284,7 @@ def _generate_cmdline_tests(): separators = [';;', ' ;; ', ';; ', ' ;;'] invalid = ['foo', ''] - valid = ['leave-mode', 'hint all'] + valid = ['mode-leave', 'hint all'] # Valid command only -> valid for item in valid: yield TestCase(''.join(item), True) diff --git a/tests/unit/misc/userscripts/test_qute_lastpass.py b/tests/unit/misc/userscripts/test_qute_lastpass.py index 14f7e8e4a..9d3a4ebc8 100644 --- a/tests/unit/misc/userscripts/test_qute_lastpass.py +++ b/tests/unit/misc/userscripts/test_qute_lastpass.py @@ -172,7 +172,7 @@ class TestQuteLastPassMain: call('fake-key \\f\\a\\k\\e\\@\\f\\a\\k\\e\\.\\c\\o\\m'), call('fake-key <Tab>'), call('fake-key \\f\\o\\o\\b\\a\\r'), - call('enter-mode insert') + call('mode-enter insert') ]) def test_main_no_candidates(self, subprocess_mock, arguments_mock, @@ -218,7 +218,7 @@ class TestQuteLastPassMain: qutecommand_mock.assert_has_calls([ call('fake-key \\f\\a\\k\\e\\@\\f\\a\\k\\e\\.\\c\\o\\m'), - call('enter-mode insert') + call('mode-enter insert') ]) def test_main_password_only_flag(self, subprocess_mock, arguments_mock, @@ -232,7 +232,7 @@ class TestQuteLastPassMain: qutecommand_mock.assert_has_calls([ call('fake-key \\f\\o\\o\\b\\a\\r'), - call('enter-mode insert') + call('mode-enter insert') ]) def test_main_multiple_candidates(self, subprocess_mock, arguments_mock, @@ -273,7 +273,7 @@ class TestQuteLastPassMain: 'fake-key \\j\\o\\h\\n\\.\\d\\o\\e\\@\\f\\a\\k\\e\\.\\c\\o\\m'), call('fake-key <Tab>'), call('fake-key \\b\\a\\r\\f\\o\\o'), - call('enter-mode insert') + call('mode-enter insert') ]) def test_main_merge_candidates(self, subprocess_mock, arguments_mock, @@ -344,5 +344,5 @@ class TestQuteLastPassMain: 'fake-key \\j\\o\\h\\n\\.\\d\\o\\e\\@\\f\\a\\k\\e\\.\\c\\o\\m'), call('fake-key <Tab>'), call('fake-key \\b\\a\\r\\f\\o\\o'), - call('enter-mode insert') + call('mode-enter insert') ]) |