Fix :tab-clone -w (i.e. back -w). Fixes #536.

This commit is contained in:
Florian Bruhin 2015-03-08 15:01:38 +01:00
parent cd34562d34
commit ee8beb174d

View File

@ -386,12 +386,13 @@ class CommandDispatcher:
""" """
if bg and window: if bg and window:
raise cmdexc.CommandError("Only one of -b/-w can be given!") raise cmdexc.CommandError("Only one of -b/-w can be given!")
tabbed_browser = self._tabbed_browser(window) cur_tabbed_browser = self._tabbed_browser()
curtab = self._current_widget() curtab = self._current_widget()
cur_title = tabbed_browser.page_title(self._current_index()) cur_title = cur_tabbed_browser.page_title(self._current_index())
newtab = tabbed_browser.tabopen(background=bg, explicit=True)
# The new tab could be in a new tabbed_browser (e.g. because of # The new tab could be in a new tabbed_browser (e.g. because of
# tabs-are-windows being set) # tabs-are-windows being set)
new_tabbed_browser = self._tabbed_browser(window)
newtab = new_tabbed_browser.tabopen(background=bg, explicit=True)
new_tabbed_browser = objreg.get('tabbed-browser', scope='window', new_tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=newtab.win_id) window=newtab.win_id)
idx = new_tabbed_browser.indexOf(newtab) idx = new_tabbed_browser.indexOf(newtab)