diff options
author | Jonathan Slenders <jonathan@slenders.be> | 2016-12-17 12:50:08 +0100 |
---|---|---|
committer | Jonathan Slenders <jonathan@slenders.be> | 2016-12-17 12:50:23 +0100 |
commit | 513112cea977af51d334166382db4343ea24ea77 (patch) | |
tree | 0089b980b1276c5b2f2e327d87377423a2bcc402 | |
parent | a7c224b7651b1ab014a848e910b0d78a773b3156 (diff) |
Take $VISUAL environment variable into account.
-rw-r--r-- | prompt_toolkit/buffer.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/prompt_toolkit/buffer.py b/prompt_toolkit/buffer.py index 70c93c82..9c6d44d7 100644 --- a/prompt_toolkit/buffer.py +++ b/prompt_toolkit/buffer.py @@ -1296,11 +1296,13 @@ class Buffer(object): Return True when we received a zero return code. """ - # If the 'EDITOR' environment variable has been set, use that one. + # If the 'VISUAL' or 'EDITOR' environment variable has been set, use that. # Otherwise, fall back to the first available editor that we can find. + visual = os.environ.get('VISUAL') editor = os.environ.get('EDITOR') editors = [ + visual, editor, # Order of preference. |