From 6608feae991beae27a01da92214b8601854ac3c5 Mon Sep 17 00:00:00 2001 From: Jonas Kattendick Date: Tue, 14 Nov 2023 17:14:45 +0100 Subject: [PATCH] feat: extract editor used into own env var Keep the old (and now default) behavior as fallback. --- agenda | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agenda b/agenda index 6458fa7..9a27a44 100644 --- a/agenda +++ b/agenda @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -euo pipefail +AGENDA_EDITOR=${VISUAL:-${EDITOR:-vi}} + # The home of all files read and written by agenda. # # If this is left empty, this will default to the xdg user DOCUMENTS directory (in a @@ -169,7 +171,7 @@ __edit() { if [ "$opt_E" = "no" ]; then export AGENDA_FILE="$file" - exec ${VISUAL:-${EDITOR:-vi}} "$file" + exec $AGENDA_EDITOR "$file" else echo "$file" fi