From f1603478415f0981ee865ee7413255318a7d7d3e Mon Sep 17 00:00:00 2001 From: Toon Nolten Date: Tue, 21 Aug 2018 10:46:37 +0200 Subject: 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 --- ranger/core/actions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: -- cgit 1.4.1-2-gfad0