Edit the config "external_editor" to overwrite $EDITOR

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-05-19 10:13:36 +02:00
parent a147e8b972
commit 0cfba17d3d
3 changed files with 15 additions and 8 deletions
+6 -1
View File
@@ -5,6 +5,8 @@ import (
"os/exec"
tea "charm.land/bubbletea/v2"
"github.com/anotherhadi/spilltea/internal/config"
)
type EditorFinishedMsg struct {
@@ -13,7 +15,10 @@ type EditorFinishedMsg struct {
}
func OpenExternalEditor(content string) tea.Cmd {
editor := os.Getenv("EDITOR")
editor := config.Global.App.ExternalEditor
if editor == "" {
editor = os.Getenv("EDITOR")
}
if editor == "" {
editor = "vi"
}