summary refs log tree commit diff stats
path: root/ranger
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 /ranger
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).
Diffstat (limited to 'ranger')
-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):
>149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212