From bf44636a2421404f6eea9732a2094cc9adf45d5d Mon Sep 17 00:00:00 2001 From: Claire Cavanaugh Date: Thu, 28 Jul 2016 22:50:10 -0700 Subject: [PATCH 1/5] :open opens quickmark when given a quckmark name --- qutebrowser/browser/commands.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 3e5581ff3..c35a390a6 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -249,12 +249,15 @@ class CommandDispatcher: "set!") else: try: - url = urlutils.fuzzy_url(url) - except urlutils.InvalidUrlError as e: - # We don't use cmdexc.CommandError here as this can be called - # async from edit_url - message.error(self._win_id, str(e)) - return + url = objreg.get('quickmark-manager').get(url) + except urlmarks.Error: + try: + url = urlutils.fuzzy_url(url) + except urlutils.InvalidUrlError as e: + # We don't use cmdexc.CommandError here as this can be called + # async from edit_url + message.error(self._win_id, str(e)) + return if tab or bg or window: self._open(url, tab, bg, window) else: From 3d258df23a8221541083d042f9f16d3c2071a44a Mon Sep 17 00:00:00 2001 From: Claire Cavanaugh Date: Thu, 28 Jul 2016 23:24:34 -0700 Subject: [PATCH 2/5] Heil PEP8 :P --- qutebrowser/browser/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index c35a390a6..60fe38021 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -254,8 +254,8 @@ class CommandDispatcher: try: url = urlutils.fuzzy_url(url) except urlutils.InvalidUrlError as e: - # We don't use cmdexc.CommandError here as this can be called - # async from edit_url + # We don't use cmdexc.CommandError here as this can be + # called async from edit_url message.error(self._win_id, str(e)) return if tab or bg or window: From e409eafe2a38569b1df9b49b95337a4661999928 Mon Sep 17 00:00:00 2001 From: Claire Cavanaugh Date: Thu, 28 Jul 2016 23:36:05 -0700 Subject: [PATCH 3/5] Add test for opening a quickmark --- tests/end2end/features/open.feature | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/end2end/features/open.feature b/tests/end2end/features/open.feature index 13f1c7cc2..4264ccb9c 100644 --- a/tests/end2end/features/open.feature +++ b/tests/end2end/features/open.feature @@ -103,3 +103,8 @@ Feature: Opening pages history: - active: true url: http://localhost:*/data/numbers/7.txt + + Scenario: Opening a quickmark + When I run :quickmark-add http://localhost:(port)/data/numbers/8.txt quickmarktest + And I run :open quickmarktest + Then data/numbers/8.txt should be loaded From af704439d93eb97b205a6490772a6f13931456c2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 29 Jul 2016 09:05:25 +0200 Subject: [PATCH 4/5] Remove trailing newline --- qutebrowser/browser/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 60fe38021..31ed521c2 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -254,7 +254,7 @@ class CommandDispatcher: try: url = urlutils.fuzzy_url(url) except urlutils.InvalidUrlError as e: - # We don't use cmdexc.CommandError here as this can be + # We don't use cmdexc.CommandError here as this can be # called async from edit_url message.error(self._win_id, str(e)) return From 88b2c20421698eafc6b5e38183465a94456729d0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 29 Jul 2016 09:06:04 +0200 Subject: [PATCH 5/5] Update docs --- CHANGELOG.asciidoc | 1 + README.asciidoc | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index e3ced7cfb..47edfc22c 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -24,6 +24,7 @@ Changed already exists. - `:bookmark-load` now has a `--delete` flag which deletes the bookmark after loading it. +- `:open` now also accepts quickmark names instead of URLs Fixed ----- diff --git a/README.asciidoc b/README.asciidoc index e1b2a8cbc..b9d46450a 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -207,6 +207,7 @@ Contributors, sorted by the number of commits in descending order: * Ismail * Edgar Hipp * Daryl Finlay +* Claire Cavanaugh * adam * Samir Benmendil * Regina Hug