Skip to content

Commit f87229d

Browse files
committed
Show better feedback on editor launch failure
1 parent 09616cb commit f87229d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/editor.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ func errUnlessExecutable(file string) error {
6969
return fmt.Errorf("Not executable: %s", file)
7070
}
7171

72+
// pickAnEditor returns the editor command to execute, where it came from
73+
// ("VISUAL", "EDITOR" or "fallback list"), and an error if no editor could
74+
// be found.
7275
func pickAnEditor() (string, string, error) {
7376
// Get an editor setting from either VISUAL or EDITOR
7477
editorEnv := "VISUAL"
@@ -202,7 +205,7 @@ func handleEditingRequest(p *Pager) {
202205
log.Warn("Failed to launch editor in paused session: ", err)
203206
p.mode = &PagerModeInfo{
204207
Pager: p,
205-
Text: "Failed to launch editor: " + err.Error(),
208+
Text: "Failed to launch editor \"" + editor + "\": " + err.Error(),
206209
}
207210

208211
return

0 commit comments

Comments
 (0)