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):
hut <hut@lavabit.com> 2013-02-10 03:28:06 +0100 committer hut <hut@lavabit.com> 2013-02-10 03:35:27 +0100 replaced tabs with 4 spaces in all python files' href='/akspecs/ranger/commit/setup.py?h=v1.9.0b5&id=d1a1173ddc315f21a3d468f43ac55aa43d31883d'>d1a1173d ^
b3660b9a ^
d1a1173d ^
3b96a37f ^




4feb2e15 ^
3b96a37f ^
b38b4dd1 ^
3b96a37f ^
3b96a37f ^
8a5944e1 ^

3cd8a402 ^


d1a1173d ^








d1a1173d ^
e6b847b3 ^
225aa78f ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50