diff options
author | mathieui <mathieui@mathieui.net> | 2013-01-02 01:19:47 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2013-01-02 01:19:47 +0100 |
commit | 677b944d3822030d917a835293fcc81fca6e8e54 (patch) | |
tree | 4015c83c8285a279ee780710cdccd7adb0494b36 /src | |
parent | a1607c4c6efbc1e0bdcb6ab5f7d6a1a15f9ca18d (diff) | |
download | poezio-677b944d3822030d917a835293fcc81fca6e8e54.tar.gz poezio-677b944d3822030d917a835293fcc81fca6e8e54.tar.bz2 poezio-677b944d3822030d917a835293fcc81fca6e8e54.tar.xz poezio-677b944d3822030d917a835293fcc81fca6e8e54.zip |
Fix a TB on /move_tab
Diffstat (limited to 'src')
-rw-r--r-- | src/core.py | 11 |
1 files changed, 3 insertions, 8 deletions
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): |