[F] Find actual editor name by tracing symlinks
This commit is contained in:
@@ -2278,6 +2278,12 @@ get_editor() {
|
|||||||
# in case neither is set just return
|
# in case neither is set just return
|
||||||
[[ -z "$editor_full_path" ]] && return
|
[[ -z "$editor_full_path" ]] && return
|
||||||
|
|
||||||
|
# Actually obtain the full path
|
||||||
|
editor_full_path="$(which "${editor_full_path}" 2>/dev/null)"
|
||||||
|
|
||||||
|
# Resolve symlink and get the original name
|
||||||
|
[[ -L "$editor_full_path" ]] && editor_full_path="$(readlink -f "$editor_full_path")"
|
||||||
|
|
||||||
case $editor_path in
|
case $editor_path in
|
||||||
on) editor="${editor_full_path} " ;;
|
on) editor="${editor_full_path} " ;;
|
||||||
off) editor="${editor_full_path##*/} " ;;
|
off) editor="${editor_full_path##*/} " ;;
|
||||||
|
|||||||
Reference in New Issue
Block a user