:navigate: command and test feature

This commit is contained in:
kanikaa1234 2016-04-19 20:30:20 +05:30
parent a2bcf80aae
commit fae005ab7f
3 changed files with 8 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
__pycache__
*.py~
*.pyc
*.swp
/build

View File

@ -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.

View File

@ -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