mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-09 09:49:09 +02:00
* fix: improve editor handling Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> * test: add tests Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com> Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
15 lines
305 B
Go
15 lines
305 B
Go
package ui
|
|
|
|
import (
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
"github.com/charmbracelet/glow/editor"
|
|
)
|
|
|
|
type editorFinishedMsg struct{ err error }
|
|
|
|
func openEditor(path string) tea.Cmd {
|
|
cb := func(err error) tea.Msg {
|
|
return editorFinishedMsg{err}
|
|
}
|
|
return tea.ExecProcess(editor.Cmd(path), cb)
|
|
}
|