Prevent :home from bypassing pinned tab warnings

Closes #3138
This commit is contained in:
Jay Kamat 2017-10-17 11:19:37 -04:00
parent 5c6a821b1e
commit 5d11a1fd75
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5
2 changed files with 13 additions and 1 deletions

View File

@ -353,6 +353,10 @@ class CommandDispatcher:
Return:
A list of URLs that can be opened.
"""
if isinstance(url, QUrl):
yield url
return
force_search = False
urllist = [u for u in url.split('\n') if u.strip()]
if (len(urllist) > 1 and not urlutils.is_url(urllist[0]) and
@ -1210,7 +1214,7 @@ class CommandDispatcher:
@cmdutils.register(instance='command-dispatcher', scope='window')
def home(self):
"""Open main startpage in current tab."""
self._current_widget().openurl(config.val.url.start_pages[0])
self.openurl(config.val.url.start_pages[0])
def _run_userscript(self, cmd, *args, verbose=False):
"""Run a userscript given as argument.

View File

@ -1197,6 +1197,14 @@ Feature: Tab management
And the following tabs should be open:
- data/numbers/1.txt (active) (pinned)
Scenario: :tab-pin open url
When I open data/numbers/1.txt
And I run :tab-pin
And I run :home
Then the message "Tab is pinned!" should be shown
And the following tabs should be open:
- data/numbers/1.txt (active) (pinned)
Scenario: Cloning a pinned tab
When I open data/numbers/1.txt
And I run :tab-pin