Merge branch 'fix/fail-tab-detach' of https://github.com/airodactyl/qutebrowser into airodactyl-fix/fail-tab-detach

This commit is contained in:
Florian Bruhin 2016-08-16 10:06:57 +02:00
commit a98d407467
2 changed files with 7 additions and 0 deletions

View File

@ -424,6 +424,8 @@ class CommandDispatcher:
@cmdutils.register(instance='command-dispatcher', scope='window')
def tab_detach(self):
"""Detach the current tab to its own window."""
if self._count() < 2:
raise cmdexc.CommandError("Cannot detach one tab.")
url = self._current_url()
self._open(url, window=True)
cur_widget = self._current_widget()

View File

@ -620,6 +620,11 @@ Feature: Tab management
- history:
- url: http://localhost:*/data/numbers/2.txt
Scenario: Detach tab from window with only one tab
When I open data/hello.txt
And I run :tab-detach
Then the error "Cannot detach one tab." should be shown
# :undo
Scenario: Undo without any closed tabs