about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2019-10-02 01:01:22 +0200
committerWojciech Siewierski <wojciech.siewierski@onet.pl>2019-10-02 01:01:22 +0200
commitb77b4c416821c6d239b5404fc8d6a7fca9d70380 (patch)
tree7e85805567c13c043690ba6dbcced07b260b99da
parent11087fd48f4fcbec9112a25d77eec0a5b2211d9f (diff)
downloadranger-b77b4c416821c6d239b5404fc8d6a7fca9d70380.tar.gz
Hotfix for an off-by-one in rifle
After #1341 the action IDs displayed by the UI were inconsistent with
the actual numbers used by rifle.  It was caused by the `ask` action
being skipped entirely (including incrementing the ID) but only in the
UI.

This is a hotfix that makes the hidden `ask` action to still take up a
number (usually (always?) 0) and thus keeping the numbering
consistent.  Bad side effect: sometimes the counting starts with 1
instead of 0 but for a time being let's choose a small inconsistency
over a BIG one.
-rwxr-xr-xranger/ext/rifle.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index a55e14c7..0a614344 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -293,6 +293,9 @@ class Rifle(object):  # pylint: disable=too-many-instance-attributes
             self._app_flags = ''
             self._app_label = None
             if skip_ask and cmd == ASK_COMMAND:
+                # TODO(vifon): Fix properly, see
+                # https://github.com/ranger/ranger/pull/1341#issuecomment-537264495
+                count += 1
                 continue
             for test in tests:
                 if not self._eval_condition(test, files, None):