From da65f7234a4e265d1619a356fc105d83973ca131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Kobezda?= Date: Sun, 4 Sep 2016 22:23:16 +0200 Subject: [PATCH 1/2] Allow :open-editor in modes other than insert ':open-editor' can now be run in all modes. Resolves #1902 --- qutebrowser/browser/commands.py | 4 ++-- tests/end2end/features/editor.feature | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 6ced51110..5dcb01576 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1472,8 +1472,8 @@ class CommandDispatcher: self.on_editing_finished, elem)) ed.edit(text) - @cmdutils.register(instance='command-dispatcher', - modes=[KeyMode.insert], hide=True, scope='window') + @cmdutils.register(instance='command-dispatcher', hide=True, + scope='window') def open_editor(self): """Open an external editor with the currently selected form field. diff --git a/tests/end2end/features/editor.feature b/tests/end2end/features/editor.feature index aac8413e6..5160ebf69 100644 --- a/tests/end2end/features/editor.feature +++ b/tests/end2end/features/editor.feature @@ -67,3 +67,29 @@ Feature: Opening external editors And I wait for "Read back: foobar" in the log And I run :click-element id qute-button Then the javascript message "text: foobar" should be logged + + Scenario: Spawning an editor in normal mode + When I set up a fake editor returning "foobar" + And I open data/editor.html + And I run :click-element id qute-textarea + And I wait for "Clicked editable element!" in the log + And I run :leave-mode + And I wait for "Leaving mode KeyMode.insert (reason: leave current)" in the log + And I run :open-editor + And I wait for "Read back: foobar" in the log + And I run :click-element id qute-button + Then the javascript message "text: foobar" should be logged + + Scenario: Spawning an editor in caret mode + When I set up a fake editor returning "foobar" + And I open data/editor.html + And I run :click-element id qute-textarea + And I wait for "Clicked editable element!" in the log + And I run :leave-mode + And I wait for "Leaving mode KeyMode.insert (reason: leave current)" in the log + And I run :enter-mode caret + And I wait for "Entering mode KeyMode.caret (reason: command)" in the log + And I run :open-editor + And I wait for "Read back: foobar" in the log + And I run :click-element id qute-button + Then the javascript message "text: foobar" should be logged From e82a119061f40f8973a4f0896ba87ed0b61342c8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 5 Sep 2016 11:00:22 +0200 Subject: [PATCH 2/2] Update docs --- CHANGELOG.asciidoc | 1 + README.asciidoc | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 53298cc4f..07a23092e 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -103,6 +103,7 @@ Changed anymore. - The `completion -> show` setting can now be set to `always`, `auto` or `never`. +- `:open-editor` can now be used in any mode. - Lots of improvements to and bugfixes for the QtWebEngine backend, such as working hints. However, using qutebrowser directly from git is still advised when using `--backend webengine`. diff --git a/README.asciidoc b/README.asciidoc index 8c06602a1..9aa59705e 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -244,6 +244,7 @@ Contributors, sorted by the number of commits in descending order: * Moez Bouhlel * Matthias Lisin * Marcel Schilling +* Ján Kobezda * Julie Engel * Johannes Martinsson * Jean-Christophe Petkovich