Allow :open without URL with -t/-b/-w
This commit is contained in:
parent
ea44c6d4b9
commit
73c608dce7
@ -150,6 +150,7 @@ Changed
|
|||||||
- `:hint` has a new `--add-history` argument to add the URL to the history for
|
- `:hint` has a new `--add-history` argument to add the URL to the history for
|
||||||
yank/spawn targets.
|
yank/spawn targets.
|
||||||
- `:set` now cycles through values if more than one argument is given.
|
- `:set` now cycles through values if more than one argument is given.
|
||||||
|
- `:open` now opens `default-page` without an URL even without `-t`/`-b`/`-w` given.
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
@ -257,13 +257,10 @@ class CommandDispatcher:
|
|||||||
count: The tab index to open the URL in, or None.
|
count: The tab index to open the URL in, or None.
|
||||||
"""
|
"""
|
||||||
if url is None:
|
if url is None:
|
||||||
if tab or bg or window:
|
urls = [config.get('general', 'default-page')]
|
||||||
urls = [config.get('general', 'default-page')]
|
|
||||||
else:
|
|
||||||
raise cmdexc.CommandError("No URL given, but -t/-b/-w is not "
|
|
||||||
"set!")
|
|
||||||
else:
|
else:
|
||||||
urls = self._parse_url_input(url)
|
urls = self._parse_url_input(url)
|
||||||
|
|
||||||
for i, cur_url in enumerate(urls):
|
for i, cur_url in enumerate(urls):
|
||||||
if not window and i > 0:
|
if not window and i > 0:
|
||||||
tab = False
|
tab = False
|
||||||
|
@ -14,9 +14,10 @@ Feature: Opening pages
|
|||||||
- active: true
|
- active: true
|
||||||
url: http://localhost:*/data/numbers/1.txt
|
url: http://localhost:*/data/numbers/1.txt
|
||||||
|
|
||||||
Scenario: :open without URL and no -t/-b/-w
|
Scenario: :open without URL
|
||||||
When I run :open
|
When I set general -> default-page to http://localhost:(port)/data/numbers/11.txt
|
||||||
Then the error "No URL given, but -t/-b/-w is not set!" should be shown
|
And I run :open
|
||||||
|
Then data/numbers/11.txt should be loaded
|
||||||
|
|
||||||
Scenario: :open without URL and -t
|
Scenario: :open without URL and -t
|
||||||
When I set general -> default-page to http://localhost:(port)/data/numbers/2.txt
|
When I set general -> default-page to http://localhost:(port)/data/numbers/2.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user