diff options
author | hut <hut@lavabit.com> | 2011-09-24 00:13:59 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-09-24 00:13:59 +0200 |
commit | f491d57798601093c1ee353aa9943e995a1e5648 (patch) | |
tree | 992750ca3e930ca2721763075175ab64a496121b /ranger/core | |
parent | 01f0ff6016f71dade2ad8a538060e66c5ef7ae12 (diff) | |
download | ranger-f491d57798601093c1ee353aa9943e995a1e5648.tar.gz |
core.actions: Added flag "c" + documentation
The "c" flag allows you to run the current file even though other files are marked. Will only work when using fm.execute_file.
Diffstat (limited to 'ranger/core')
-rw-r--r-- | ranger/core/actions.py | 7 | ||||
-rw-r--r-- | ranger/core/runner.py | 2 |
2 files changed, 8 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(): |