From 7e8d61c01754de548da054dc2e4a2f48738d20a8 Mon Sep 17 00:00:00 2001 From: Thomas Dupond Date: Tue, 23 Nov 2021 21:32:35 +0100 Subject: [PATCH] Prefer VISUAL over EDITOR for editmenu --- pkg/menus/edit_menu.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/menus/edit_menu.go b/pkg/menus/edit_menu.go index 0a68c904..6dba59b3 100644 --- a/pkg/menus/edit_menu.go +++ b/pkg/menus/edit_menu.go @@ -30,8 +30,8 @@ func editor(editorConfig, editorFlags string, noConfirm bool) (editor string, ar } fallthrough - case os.Getenv("EDITOR") != "": - if editorArgs := strings.Fields(os.Getenv("EDITOR")); len(editorArgs) != 0 { + case os.Getenv("VISUAL") != "": + if editorArgs := strings.Fields(os.Getenv("VISUAL")); len(editorArgs) != 0 { editor, err := exec.LookPath(editorArgs[0]) if err != nil { fmt.Fprintln(os.Stderr, err) @@ -41,8 +41,8 @@ func editor(editorConfig, editorFlags string, noConfirm bool) (editor string, ar } fallthrough - case os.Getenv("VISUAL") != "": - if editorArgs := strings.Fields(os.Getenv("VISUAL")); len(editorArgs) != 0 { + case os.Getenv("EDITOR") != "": + if editorArgs := strings.Fields(os.Getenv("EDITOR")); len(editorArgs) != 0 { editor, err := exec.LookPath(editorArgs[0]) if err != nil { fmt.Fprintln(os.Stderr, err)