diff options
-rwxr-xr-x | ranger/ext/rifle.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py index 36f3243e..84b8f375 100755 --- a/ranger/ext/rifle.py +++ b/ranger/ext/rifle.py @@ -343,10 +343,15 @@ 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 'VISUAL' not in os.environ: + if 'EDITOR' not in os.environ: + os.environ['VISUAL'] = DEFAULT_EDITOR + # necessary for compatibility with old rifle.conf + os.environ['EDITOR'] = DEFAULT_EDITOR + else: + if 'EDITOR' not in os.environ: + # similar to new behavior for old rifle.conf + os.environ['EDITOR'] = os.environ['VISUAL'] command = self.hook_command_postprocessing(command) self.hook_before_executing(command, self._mimetype, self._app_flags) try: |