# HG changeset patch
# User Scott K Logan <logans@cottsay.net>
# Date 1415482316 28800
# Node ID 1013bb47ac751cbfba95ea8e64dc1296ffa033ed
# Parent d8efc8c3d455788c9a15d97f87655399d1341c5b
Fix previous tab selection without history
diff --git a/iep/iepcore/editorTabs.py b/iep/iepcore/editorTabs.py
--- a/iep/iepcore/editorTabs.py
+++ b/iep/iepcore/editorTabs.py
@@ -685,7 +685,7 @@
"""
if isinstance(item, int):
- self.setCurrentIndex(i)
+ self.setCurrentIndex(item)
elif isinstance(item, FileItem):
@@ -711,12 +711,12 @@
""" Select the previously selected item. """
# make an old item history
- if len(self._itemHistory)>1:
+ if len(self._itemHistory)>1 and self._itemHistory[1] is not None:
item = self._itemHistory[1]
self.setCurrentItem(item)
# just select first one then ...
- elif item is None and self.count():
+ elif self.count():
item = 0
self.setCurrentItem(item)