Reverse if/else
This commit is contained in:
parent
2c86788901
commit
ced4713fda
@ -543,16 +543,17 @@ class CommandDispatcher:
|
||||
if win_id == self._win_id:
|
||||
raise cmdexc.CommandError("Can't give a tab to the same window")
|
||||
|
||||
if win_id is not None:
|
||||
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
||||
window=win_id)
|
||||
else:
|
||||
if win_id is None:
|
||||
if self._count() < 2:
|
||||
raise cmdexc.CommandError("Cannot detach from a window with "
|
||||
"only one tab")
|
||||
|
||||
tabbed_browser = self._new_tabbed_browser(
|
||||
private=self._tabbed_browser.private)
|
||||
private=self._tabbed_browser.private)
|
||||
else:
|
||||
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
||||
window=win_id)
|
||||
|
||||
tabbed_browser.tabopen(self._current_url())
|
||||
self._tabbed_browser.close_tab(self._current_widget(), add_undo=False)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user