getDefaultEditor is taken from https://github.com/cli/cli/blob/trunk/pkg/surveyext/editor_manual.go and tries to infer the editor from different heuristics.
()
| 135 | // getDefaultEditor is taken from https://github.com/cli/cli/blob/trunk/pkg/surveyext/editor_manual.go |
| 136 | // and tries to infer the editor from different heuristics. |
| 137 | func getDefaultEditor() string { |
| 138 | if g := os.Getenv("GIT_EDITOR"); g != "" { |
| 139 | return g |
| 140 | } else if v := os.Getenv("VISUAL"); v != "" { |
| 141 | return v |
| 142 | } else if e := os.Getenv("EDITOR"); e != "" { |
| 143 | return e |
| 144 | } else if runtime.GOOS == "windows" { |
| 145 | return "notepad" |
| 146 | } |
| 147 | |
| 148 | return defaultEditor |
| 149 | } |
no outgoing calls
no test coverage detected