From fae005ab7f6a2177cb3a1b812d0963781dedcc27 Mon Sep 17 00:00:00 2001 From: kanikaa1234 Date: Tue, 19 Apr 2016 20:30:20 +0530 Subject: [PATCH] :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