apps/sipp/tui/editor.go 371 B raw
1
package tui
2
3
import (
4
	"path/filepath"
5
6
	tea "charm.land/bubbletea/v2"
7
	sharedtui "github.com/stevedylandev/andromeda/pkg/tui"
8
)
9
10
func openExternalEditor(shortID, name, content string) tea.Cmd {
11
	base := name
12
	if base == "" {
13
		base = "snippet.txt"
14
	}
15
	pattern := "sipp-" + shortID + "-*-" + filepath.Base(base)
16
	return sharedtui.SpawnEditor(shortID, pattern, content)
17
}