From c66bae5412dcd0e2599e2c903e821e80762e3d3d Mon Sep 17 00:00:00 2001
From: mathieui <mathieui@mathieui.net>
Date: Tue, 6 May 2014 00:27:05 +0200
Subject: When closing a tab, go to the previous one, and not the one before it
 in the tab list

---
 src/core/core.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/core/core.py b/src/core/core.py
index 622cad78..e340bd5d 100644
--- a/src/core/core.py
+++ b/src/core/core.py
@@ -1234,6 +1234,9 @@ class Core(object):
         del tab.commands      # and make the object collectable
         tab.on_close()
         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 nb >= len(self.tabs) - 1:
                 self.tabs.remove(tab)
-- 
cgit v1.2.3