summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorToon Nolten <toon.nolten@student.kuleuven.be>2018-08-21 10:46:37 +0200
committerToon Nolten <toon.nolten@student.kuleuven.be>2018-08-21 11:17:57 +0200
commitf1603478415f0981ee865ee7413255318a7d7d3e (patch)
tree104920cfae1cbe8b36d890510bc8e1ae0912a5a0 /ranger
parent8d4808fc6a0f36960ff9999b99e9030d93286e41 (diff)
downloadranger-f1603478415f0981ee865ee7413255318a7d7d3e.tar.gz
Add selection argument to move action
If `selection == False` don't operate on the entire selection (the
marked files) but only on the file under the cursor.

Inconsistent, I noticed `move to=100 percentage=true` works as expected
but `move right=1 selection=false` doesn't. You need to pass `False`,
most other values test as `True` in python, so `true` works *but*
surprisingly imo, `false == True`.

Fixes #1233
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 83cfcc08..1417ac96 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -489,7 +489,10 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
             if narg is not None:
                 mode = narg
             tfile = self.thisfile
-            selection = self.thistab.get_selection()
+            if not kw.get('selection', True):
+                selection = [tfile]
+            else:
+                selection = self.thistab.get_selection()
             if tfile.is_directory:
                 self.thistab.enter_dir(tfile)
             elif selection: