When closing a tab, go to the previous one, and not the one before it in the tab list

This commit is contained in:
mathieui 2014-05-06 00:27:05 +02:00
parent 16276cd163
commit c66bae5412

View file

@ -1234,6 +1234,9 @@ class Core(object):
del tab.commands # and make the object collectable del tab.commands # and make the object collectable
tab.on_close() tab.on_close()
nb = tab.nb nb = tab.nb
if self.previous_tab_nb != nb:
self.current_tab_nb = self.previous_tab_nb
self.previous_tab_nb = 0
if config.get('create_gaps', False): if config.get('create_gaps', False):
if nb >= len(self.tabs) - 1: if nb >= len(self.tabs) - 1:
self.tabs.remove(tab) self.tabs.remove(tab)