From 8c7c686d3fdbec2f49e33dd0a5674298233850d0 Mon Sep 17 00:00:00 2001 From: lyeoh Date: Sat, 3 Nov 2018 12:36:19 -0500 Subject: [PATCH 1/4] Strip fragment and query only for `:navigate up` --- qutebrowser/browser/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 096a324d2..d0627de92 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -636,7 +636,6 @@ class CommandDispatcher: cmdutils.check_exclusive((tab, bg, window), 'tbw') widget = self._current_widget() url = self._current_url() - url = url.adjusted(QUrl.RemoveFragment | QUrl.RemoveQuery) handlers = { 'prev': functools.partial(navigate.prevnext, prev=True), @@ -654,6 +653,8 @@ class CommandDispatcher: handler(browsertab=widget, win_id=self._win_id, baseurl=url, tab=tab, background=bg, window=window) elif where in ['up', 'increment', 'decrement']: + if where is 'up': + url = url.adjusted(QUrl.RemoveFragment | QUrl.RemoveQuery) new_url = handlers[where](url, count) self._open(new_url, tab, bg, window, related=True) else: # pragma: no cover From 4e1d63ee5f582eda94ee21c9a2019666861bbde9 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Sat, 3 Nov 2018 11:01:50 -0700 Subject: [PATCH 2/4] Add tests for query increment --- tests/end2end/features/navigate.feature | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/end2end/features/navigate.feature b/tests/end2end/features/navigate.feature index f3de78a6a..07bd56c69 100644 --- a/tests/end2end/features/navigate.feature +++ b/tests/end2end/features/navigate.feature @@ -125,6 +125,12 @@ Feature: Using :navigate And I run :navigate increment Then the error "No number found in URL!" should be shown + Scenario: Incrementing query + When I set url.incdec_segments to ["query"] + And I open data/numbers/1.txt?value=2 + And I run :navigate increment + Then data/numbers/1.txt?value=3 should be loaded + @qtwebengine_todo: Doesn't find any elements Scenario: Navigating multiline links When I open data/navigate/multilinelinks.html From 3e1bfc3e28e7a48021a3b528a235f06c8eb8ced6 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Mon, 12 Nov 2018 18:35:11 -0800 Subject: [PATCH 3/4] Fix 'in' vs 'equal' error --- 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 d0627de92..ceafbc011 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -653,7 +653,7 @@ class CommandDispatcher: handler(browsertab=widget, win_id=self._win_id, baseurl=url, tab=tab, background=bg, window=window) elif where in ['up', 'increment', 'decrement']: - if where is 'up': + if where == 'up': url = url.adjusted(QUrl.RemoveFragment | QUrl.RemoveQuery) new_url = handlers[where](url, count) self._open(new_url, tab, bg, window, related=True) From 16bad3184b21ed35f785af959be8588812d059e1 Mon Sep 17 00:00:00 2001 From: Jay Kamat Date: Mon, 12 Nov 2018 18:38:26 -0800 Subject: [PATCH 4/4] Update changelog --- doc/changelog.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 93cffe40c..22c5fd333 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -65,6 +65,7 @@ Fixed `content.cookies.accept = no-3rdparty` from working properly on some pages like GMail. However, the default for `content.cookies.accept` is still `all` to be in line with what other browsers do. +- `:navigate` not incrementing in anchors or queries or anchors. v1.5.2 ------