summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-12-15 21:49:11 +0100
committermathieui <mathieui@mathieui.net>2012-12-15 21:49:11 +0100
commit4f084671d3a345043b92495b6b4147dbad76428e (patch)
tree73d1cae3dc845ba4d8df4a7f2d8dd1de0728aa4b /src/core.py
parent9f7a16141ab7f4ac6b094eb5d0836507e3edf80c (diff)
downloadpoezio-4f084671d3a345043b92495b6b4147dbad76428e.tar.gz
poezio-4f084671d3a345043b92495b6b4147dbad76428e.tar.bz2
poezio-4f084671d3a345043b92495b6b4147dbad76428e.tar.xz
poezio-4f084671d3a345043b92495b6b4147dbad76428e.zip
(should) Fix #2175 ; prevent bugs caused by tab gaps
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index e74ecd01..6bd54efb 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1012,6 +1012,10 @@ class Core(object):
if config.get('create_gaps', 'false').lower() == 'true':
if nb >= len(self.tabs) - 1:
self.tabs.remove(tab)
+ nb -= 1
+ while not self.tabs[nb]: # remove the trailing gaps
+ self.tabs.pop()
+ nb -= 1
else:
self.tabs[nb] = tabs.GapTab()
else:
@@ -1506,6 +1510,8 @@ class Core(object):
self.current_tab().on_lose_focus()
if isinstance(nb, int):
if 0 <= nb < len(self.tabs):
+ if not self.tabs[nb]:
+ return
self.current_tab_nb = nb
else:
for tab in self.tabs: