From 9e34fc04c31fa00f97a889be2d41fb43d44deeb0 Mon Sep 17 00:00:00 2001 From: Einhard Leichtfuß Date: Thu, 10 Jan 2019 08:17:52 +0100 Subject: Honor $VISUAL It does now take precedence over $EDITOR when editing files. You probably do not want to edit contact entries with ed. --- ctct.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ctct.in') diff --git a/ctct.in b/ctct.in index d03112f..af880e2 100644 --- a/ctct.in +++ b/ctct.in @@ -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 -- cgit v1.2.3