summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-08-07 20:46:41 +0200
committerhut <hut@lavabit.com>2012-08-07 20:46:41 +0200
commit5ee1e874cc5f9136af3a9a835b76076a85693bd0 (patch)
treed54938f309b9595e7ef6c07c16363e16ff899703
parent14412eea0cd7ec556062f8f984dc5577ebdc8b30 (diff)
downloadranger-5ee1e874cc5f9136af3a9a835b76076a85693bd0.tar.gz
core.tab: fixed restoring pointer on tab change
-rw-r--r--ranger/core/actions.py6
-rw-r--r--ranger/core/tab.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 95a536ef..2f76527a 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -840,7 +840,6 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		previous_tab = self.thistab
 		try:
 			tab = self.tabs[name]
-			tab.enter_dir(tab.path, history=False)
 		except KeyError:
 			# create a new tab
 			if path:
@@ -848,10 +847,13 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 			else:
 				tab = Tab(self.thistab.path)
 			self.tabs[name] = tab
+			self.thistab = tab
 			tab.enter_dir(tab.path, history=True)
 			if previous_tab:
 				tab.inherit_history(previous_tab.history)
-		self.thistab = tab
+		else:
+			self.thistab = tab
+			tab.enter_dir(tab.path, history=False)
 
 		if tab_has_changed:
 			self.change_mode('normal')
diff --git a/ranger/core/tab.py b/ranger/core/tab.py
index 2fd71cb6..6059eb6b 100644
--- a/ranger/core/tab.py
+++ b/ranger/core/tab.py
@@ -146,7 +146,7 @@ class Tab(FileManagerAware, SettingsAware):
 		self.thisdir.sort_directories_first = self.fm.settings.sort_directories_first
 		self.thisdir.sort_reverse = self.fm.settings.sort_reverse
 		self.thisdir.sort_if_outdated()
-		self.thisfile = self.thisdir.pointed_obj
+		self._thisfile = self.thisdir.pointed_obj
 
 		if history:
 			self.history.add(new_thisdir)