From 677b944d3822030d917a835293fcc81fca6e8e54 Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 2 Jan 2013 01:19:47 +0100 Subject: Fix a TB on /move_tab --- src/core.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/core.py') diff --git a/src/core.py b/src/core.py index d147e7ce..1ac0fe7f 100644 --- a/src/core.py +++ b/src/core.py @@ -754,22 +754,17 @@ class Core(object): if new_pos > old_pos: self.tabs.insert(new_pos, tab) self.tabs[old_pos] = tabs.GapTab() - i = self.tabs.index(tab) elif new_pos < old_pos: self.tabs[old_pos] = tabs.GapTab() self.tabs.insert(new_pos, tab) else: return False + i = self.tabs.index(tab) done = False # Remove the first Gap on the right in the list # in order to prevent global shifts when there is empty space - while not done: - i += 1 - if i >= len(self.tabs): - done = True - elif not self.tabs[i]: - self.tabs.pop(i) - done = True + if i < len(self.tabs) and not self.tabs[i]: + self.tabs.pop(i) # Remove the trailing gaps i = len(self.tabs) - 1 while isinstance(self.tabs[i], tabs.GapTab): -- cgit v1.2.3