From bf44636a2421404f6eea9732a2094cc9adf45d5d Mon Sep 17 00:00:00 2001 From: Claire Cavanaugh Date: Thu, 28 Jul 2016 22:50:10 -0700 Subject: [PATCH 1/3] :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/3] 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/3] 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