mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-17 01:42:45 +02:00
fallback to vi when trying to edit file and no EDITOR/VISUAL is defined
This commit is contained in:
@ -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.")
|
||||
}
|
||||
|
Reference in New Issue
Block a user