]> granicus.if.org Git - graphviz/commitdiff
Make vimdot work with $EDITOR that is not a full path
authorJakub Kaczor <jakub@jakubkaczor.com>
Fri, 30 Sep 2022 10:06:20 +0000 (10:06 +0000)
committerJakub Kaczor <jakub@jakubkaczor.com>
Fri, 30 Sep 2022 10:06:20 +0000 (10:06 +0000)
plugin/xlib/vimdot.sh

index 1ca125954e1671ec4d74a7fa5468c98c6ba54f4a..55fc476d5782bb6322240d636ee30eb827eb4d11 100755 (executable)
@@ -9,8 +9,7 @@ fi
 error() { echo "$0: $*" >&2; exit 1; }
 
 # Try $EDITOR first, else try vim or vi
-editor="$EDITOR"
-[ -x "$editor" ] || editor="/usr/bin/vim"
+editor="$(which $EDITOR)" || editor="/usr/bin/vim"
 [ -x "$editor" ] || editor="/usr/bin/vi"
 [ -x "$editor" ] || error "EDITOR not found or not executable";