diff options
author | Einhard Leichtfuß <alguien@respiranto.de> | 2019-01-10 08:17:52 +0100 |
---|---|---|
committer | Einhard Leichtfuß <alguien@respiranto.de> | 2019-01-10 08:17:52 +0100 |
commit | 9e34fc04c31fa00f97a889be2d41fb43d44deeb0 (patch) | |
tree | 5f4a59747a5f32b2d0dc397bc05c7915f8045537 /ctct.in | |
parent | 0f8ac72b86937513bf10c3ce21ac445724e9a13a (diff) |
Honor $VISUAL
It does now take precedence over $EDITOR when editing files.
You probably do not want to edit contact entries with ed.
Diffstat (limited to 'ctct.in')
-rw-r--r-- | ctct.in | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -26,7 +26,7 @@ sysconfdir="@sysconfdir_expanded@" user_config_file="@default_user_config_file@" datadir="@default_datadir@" fallback_editor=("@default_fallback_editor@") -default_editor=() # none - use $EDITOR +default_editor=() # none - use $VISUAL / $EDITOR input_program=("@default_input_program@") output_program=("@default_output_program@") visual_program=("@default_visual_program@") @@ -316,7 +316,10 @@ function edit_contact() if test -n "${default_editor[*]}" then editor=( "${default_editor[@]}" ) - elif test -n "$EDITOR" && which "${EDITOR% *}" >/dev/null 2>&1 + elif test -n "$VISUAL" + then + editor=( $VISUAL ) + elif test -n "$EDITOR" then editor=( $EDITOR ) else |