Give error when trying to detach a single tab
This commit is contained in:
parent
5c766ff7da
commit
c0ab474b21
@ -424,6 +424,8 @@ class CommandDispatcher:
|
|||||||
@cmdutils.register(instance='command-dispatcher', scope='window')
|
@cmdutils.register(instance='command-dispatcher', scope='window')
|
||||||
def tab_detach(self):
|
def tab_detach(self):
|
||||||
"""Detach the current tab to its own window."""
|
"""Detach the current tab to its own window."""
|
||||||
|
if self._count() < 2:
|
||||||
|
raise cmdexc.CommandError("Cannot detach one tab.")
|
||||||
url = self._current_url()
|
url = self._current_url()
|
||||||
self._open(url, window=True)
|
self._open(url, window=True)
|
||||||
cur_widget = self._current_widget()
|
cur_widget = self._current_widget()
|
||||||
|
@ -620,6 +620,12 @@ Feature: Tab management
|
|||||||
- history:
|
- history:
|
||||||
- url: http://localhost:*/data/numbers/2.txt
|
- url: http://localhost:*/data/numbers/2.txt
|
||||||
|
|
||||||
|
Scenario: Detach tab from window with only one tab
|
||||||
|
Given I have a fresh instance
|
||||||
|
When I open data/hello.txt
|
||||||
|
And I run :tab-detach
|
||||||
|
Then the error "Cannot detach one tab." should be shown
|
||||||
|
|
||||||
# :undo
|
# :undo
|
||||||
|
|
||||||
Scenario: Undo without any closed tabs
|
Scenario: Undo without any closed tabs
|
||||||
|
Loading…
Reference in New Issue
Block a user