mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-26 09:00:57 +02: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 New Issue
Block a user