mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-13 00:56:25 -04:00
fallback to vi when trying to edit file and no EDITOR/VISUAL is defined
This commit is contained in:
parent
6d4d6d3ac0
commit
f0840c0f46
|
|
@ -271,6 +271,11 @@ func editFile(g *gocui.Gui, filename string) (string, error) {
|
|||
if editor == "" {
|
||||
editor = os.Getenv("EDITOR")
|
||||
}
|
||||
if editor == "" {
|
||||
if _, err := runCommand("which vi"); err == nil {
|
||||
editor = "vi"
|
||||
}
|
||||
}
|
||||
if editor == "" {
|
||||
return "", createErrorPanel(g, "No editor defined in $VISUAL, $EDITOR, or git config.")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue