mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
docs: default to vim if no EDITOR on exec example (#325)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
04d68b8e3e
commit
b566614c16
@@ -11,7 +11,11 @@ import (
|
||||
type editorFinishedMsg struct{ err error }
|
||||
|
||||
func openEditor() tea.Cmd {
|
||||
c := exec.Command(os.Getenv("EDITOR")) //nolint:gosec
|
||||
editor := os.Getenv("EDITOR")
|
||||
if editor == "" {
|
||||
editor = "vim"
|
||||
}
|
||||
c := exec.Command(editor) //nolint:gosec
|
||||
return tea.ExecProcess(c, func(err error) tea.Msg {
|
||||
return editorFinishedMsg{err}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user