Ignore on_current_changed when last tab is closed. Fixes #146.

This commit is contained in:
Florian Bruhin 2014-10-05 19:47:12 +02:00
parent 48a7a428a5
commit 0d2ce778f3

View File

@ -496,6 +496,9 @@ class TabbedBrowser(tabwidget.TabWidget):
@pyqtSlot(int)
def on_current_changed(self, idx):
"""Set last-focused-tab and leave hinting mode when focus changed."""
if idx == -1:
# closing the last tab (before quitting)
return
tab = self.widget(idx)
tab.setFocus()
modeman.maybe_leave(usertypes.KeyMode.hint, 'tab changed')