summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py7
-rw-r--r--ranger/core/runner.py2
-rw-r--r--ranger/help/starting.py1
3 files changed, 9 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index d77f2a86..c8dffa55 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -163,6 +163,13 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		elif type(files) not in (list, tuple):
 			files = [files]
 
+		if 'flags' in kw:
+			from ranger.core.runner import Context
+			context = Context(files=list(files), flags=kw['flags'])
+			context.squash_flags()
+			if 'c' in context.flags:
+				files = [self.fm.env.cf]
+
 		self.signal_emit('execute.before', keywords=kw)
 		try:
 			return self.run(files=list(files), **kw)
diff --git a/ranger/core/runner.py b/ranger/core/runner.py
index dd0cf06a..53bede29 100644
--- a/ranger/core/runner.py
+++ b/ranger/core/runner.py
@@ -37,7 +37,7 @@ from subprocess import Popen, PIPE
 from ranger.ext.waitpid_no_intr import waitpid_no_intr
 
 
-ALLOWED_FLAGS = 'sdpwSDPW'
+ALLOWED_FLAGS = 'sdpwcSDPWC'
 
 
 def press_enter():
diff --git a/ranger/help/starting.py b/ranger/help/starting.py
index 1796f83d..dbc6b6b5 100644
--- a/ranger/help/starting.py
+++ b/ranger/help/starting.py
@@ -103,6 +103,7 @@ Flags give you a way to modify the behaviour of the spawned process.
 	d	Detach the process.  (Run in background)
 	p	Redirect output to the pager
 	w	Wait for an enter-press when the process is done
+	c	Run the current file only, even when more files are marked
 
 For example, ":open_with p" will pipe the output of that process into
 the pager.