summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-12-14 11:55:18 +0100
committerhut <hut@lavabit.com>2012-12-14 11:55:47 +0100
commit56d1eb636c7b8644729b6e50ad4fac7903b18849 (patch)
tree78ad1a6d68027ffda367d94f82f6aebde2ac2eef
parentbcd3f81c07818d5bd87d53f50a126071fcc2a175 (diff)
downloadranger-56d1eb636c7b8644729b6e50ad4fac7903b18849.tar.gz
core.tab: make tab.get_selection() cursor-agnostic
Without this, if you enter another tab, the cursor of the directory may
change and get_selection() will not return the actual selected file of
the tab anymore (unless they have been marked, in which case
everything's fine).
-rw-r--r--ranger/core/tab.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/core/tab.py b/ranger/core/tab.py
index 6059eb6b..433bfb75 100644
--- a/ranger/core/tab.py
+++ b/ranger/core/tab.py
@@ -78,7 +78,10 @@ class Tab(FileManagerAware, SettingsAware):
 
 	def get_selection(self):
 		if self.thisdir:
-			return self.thisdir.get_selection()
+			if self.thisdir.marked_items:
+				return self.thisdir.get_selection()
+			else:
+				return [self._thisfile]
 		return set()
 
 	def assign_cursor_positions_for_subdirs(self):