about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-05-20 20:00:39 +0200
committertoonn <toonn@toonn.io>2019-05-20 20:00:39 +0200
commit0cf33f2f7256429c616917c370675cc39091b35a (patch)
treeec28e842e4378655f748c3bbc8b05ee168f61d03 /ranger
parentaf393277e9c6b9a6b71a7cec1a6f210333219a31 (diff)
parent65832d74998e772230fcdbfe64c5f2ffb671102a (diff)
downloadranger-0cf33f2f7256429c616917c370675cc39091b35a.tar.gz
Merge branch 'germainz-skip_ask'
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py3
-rwxr-xr-xranger/ext/rifle.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index e7be0c65..435fcf13 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -960,7 +960,8 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
         except IndexError:
             self.ui.browser.draw_info = []
             return
-        programs = [program for program in self.rifle.list_commands([target.path], None)]
+        programs = [program for program in self.rifle.list_commands([target.path], None,
+                                                                    skip_ask=True)]
         if programs:
             num_digits = max((len(str(program[0])) for program in programs))
             program_info = ['%s | %s' % (str(program[0]).rjust(num_digits), program[1])
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index ad7d0049..a55e14c7 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -277,7 +277,7 @@ class Rifle(object):  # pylint: disable=too-many-instance-attributes
         filenames = "' '".join(f.replace("'", "'\\\''") for f in files if "\x00" not in f)
         return "set -- '%s'; %s" % (filenames, action)
 
-    def list_commands(self, files, mimetype=None):
+    def list_commands(self, files, mimetype=None, skip_ask=False):
         """List all commands that are applicable for the given files
 
         Returns one 4-tuple for all currently applicable commands
@@ -292,6 +292,8 @@ class Rifle(object):  # pylint: disable=too-many-instance-attributes
             self._skip = None
             self._app_flags = ''
             self._app_label = None
+            if skip_ask and cmd == ASK_COMMAND:
+                continue
             for test in tests:
                 if not self._eval_condition(test, files, None):
                     break