diff options
author | hut <hut@lavabit.com> | 2012-12-14 11:55:18 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-12-14 11:55:47 +0100 |
commit | 56d1eb636c7b8644729b6e50ad4fac7903b18849 (patch) | |
tree | 78ad1a6d68027ffda367d94f82f6aebde2ac2eef | |
parent | bcd3f81c07818d5bd87d53f50a126071fcc2a175 (diff) | |
download | ranger-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.py | 5 |
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): |