浏览代码

Prefer VISUAL over EDITOR for editmenu

Thomas Dupond 3 年之前
父节点
当前提交
7e8d61c017
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      pkg/menus/edit_menu.go

+ 4 - 4
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)