summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorToon Nolten <toonn@toonn.io>2018-01-31 20:22:11 +0100
committerGitHub <noreply@github.com>2018-01-31 20:22:11 +0100
commit78722ddc70750cb63e18e1173b61c9bb571baf0b (patch)
tree4ed851d4861ed8001ba55a264df78015f02e3d9f
parent6ceebfaf15af59d6b14305cc66c66dccd01d8664 (diff)
parentd42bfdef2b9f2c530f24ab39a9a2417068d5788a (diff)
downloadranger-78722ddc70750cb63e18e1173b61c9bb571baf0b.tar.gz
Merge pull request #1049 from toonn/visualeditfix
Make new `rifle` behavior backwards compatible.
-rwxr-xr-xranger/ext/rifle.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index 36f3243e..8f28cef8 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -343,10 +343,8 @@ class Rifle(object):  # pylint: disable=too-many-instance-attributes
         else:
             if 'PAGER' not in os.environ:
                 os.environ['PAGER'] = DEFAULT_PAGER
-            if 'VISUAL' not in os.environ and 'EDITOR' not in os.environ:
-                os.environ['VISUAL'] = DEFAULT_EDITOR
-                # necessary for compatibility with old rifle.conf
-                os.environ['EDITOR'] = DEFAULT_EDITOR
+            if 'EDITOR' not in os.environ:
+                os.environ['EDITOR'] = os.environ.get('VISUAL', DEFAULT_EDITOR)
             command = self.hook_command_postprocessing(command)
             self.hook_before_executing(command, self._mimetype, self._app_flags)
             try: