From 5c976d724bd97d86e6c8a98e0b8c23958c8375b3 Mon Sep 17 00:00:00 2001 From: kanikaa1234 Date: Fri, 8 Apr 2016 19:40:45 +0530 Subject: [PATCH 1/6] Fixes #1318 --- .gitignore | 1 + qutebrowser/browser/commands.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index e1db4729d..de98a1034 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,5 @@ __pycache__ /.testmondata /.hypothesis /prof +/venv TODO diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 3cae6941c..a662c8465 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -440,10 +440,14 @@ class CommandDispatcher: window: Open the link in a new window. """ path = url.path() + #print (url.Qurl) + print (path) if not path or path == '/': raise cmdexc.CommandError("Can't go up!") new_path = posixpath.join(path, posixpath.pardir) + print (new_path) url.setPath(new_path) + url.setFragment('') self._open(url, tab, background, window) @cmdutils.register(instance='command-dispatcher', scope='window') From a2bcf80aaead828f6b0855455ac031cdb399caeb Mon Sep 17 00:00:00 2001 From: kanikaa1234 Date: Fri, 8 Apr 2016 20:51:07 +0530 Subject: [PATCH 2/6] Fixed the tests --- qutebrowser/browser/commands.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index a662c8465..5141ed552 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -440,14 +440,11 @@ class CommandDispatcher: window: Open the link in a new window. """ path = url.path() - #print (url.Qurl) - print (path) if not path or path == '/': raise cmdexc.CommandError("Can't go up!") new_path = posixpath.join(path, posixpath.pardir) - print (new_path) url.setPath(new_path) - url.setFragment('') + url.setFragment(None) self._open(url, tab, background, window) @cmdutils.register(instance='command-dispatcher', scope='window') From fae005ab7f6a2177cb3a1b812d0963781dedcc27 Mon Sep 17 00:00:00 2001 From: kanikaa1234 Date: Tue, 19 Apr 2016 20:30:20 +0530 Subject: [PATCH 3/6] :navigate: command and test feature --- .gitignore | 1 + qutebrowser/browser/commands.py | 2 ++ tests/integration/features/navigate.feature | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index de98a1034..2bc5b3e7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ __pycache__ +*.py~ *.pyc *.swp /build diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 5141ed552..75883f7c6 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -428,7 +428,9 @@ class CommandDispatcher: new_url = urlutils.incdec_number(url, incdec, segments=segments) except urlutils.IncDecError as error: raise cmdexc.CommandError(error.msg) + url.setFragment(None) self._open(new_url, tab, background, window) + def _navigate_up(self, url, tab, background, window): """Helper method for :navigate when `where' is up. diff --git a/tests/integration/features/navigate.feature b/tests/integration/features/navigate.feature index e5fd20d52..b356e399c 100644 --- a/tests/integration/features/navigate.feature +++ b/tests/integration/features/navigate.feature @@ -38,6 +38,11 @@ Feature: Using :navigate And I run :navigate next Then the error "No forward links found!" should be shown + Scenario: Navigating to next page to a fragment + When I open data/navigate#fragment + And I run :navigate next + Then data/navigate/next.html should be loaded + # increment/decrement Scenario: Incrementing number in URL From 22ad416f352065a4ab58bd2c9dc3988877feedc9 Mon Sep 17 00:00:00 2001 From: kanikaa1234 Date: Sun, 24 Apr 2016 19:33:31 +0530 Subject: [PATCH 4/6] Addressing test --- 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 75883f7c6..4937a3766 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -428,9 +428,9 @@ class CommandDispatcher: new_url = urlutils.incdec_number(url, incdec, segments=segments) except urlutils.IncDecError as error: raise cmdexc.CommandError(error.msg) - url.setFragment(None) + url.setFragment(None) + self._open(new_url, tab, background, window) - def _navigate_up(self, url, tab, background, window): """Helper method for :navigate when `where' is up. From 341dae0b3f74e63e252d0ab1507cd099fc65174e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Apr 2016 19:05:20 +0200 Subject: [PATCH 5/6] Simplify deleting fragment --- qutebrowser/browser/commands.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index a81bbfa9d..b37987866 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -430,7 +430,6 @@ class CommandDispatcher: new_url = urlutils.incdec_number(url, incdec, segments=segments) except urlutils.IncDecError as error: raise cmdexc.CommandError(error.msg) - url.setFragment(None) self._open(new_url, tab, background, window) @@ -448,7 +447,6 @@ class CommandDispatcher: raise cmdexc.CommandError("Can't go up!") new_path = posixpath.join(path, posixpath.pardir) url.setPath(new_path) - url.setFragment(None) self._open(url, tab, background, window) @cmdutils.register(instance='command-dispatcher', scope='window') @@ -481,7 +479,7 @@ class CommandDispatcher: cmdutils.check_exclusive((tab, bg, window), 'tbw') widget = self._current_widget() frame = widget.page().currentFrame() - url = self._current_url() + url = self._current_url().adjusted(QUrl.RemoveFragment) if frame is None: raise cmdexc.CommandError("No frame focused!") hintmanager = objreg.get('hintmanager', scope='tab', tab='current') From 3fa5c8885ebe89c84c5ee1d203a0704c14cc8bc9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 25 Apr 2016 19:05:55 +0200 Subject: [PATCH 6/6] Regenerate authors --- README.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/README.asciidoc b/README.asciidoc index f02f71a73..01bbe9468 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -184,6 +184,7 @@ Contributors, sorted by the number of commits in descending order: * Zach-Button * Halfwit * rikn00 +* kanikaa1234 * Michael Ilsaas * Martin Zimmermann * Brian Jackson