Documentation
¶
Index ¶
- func ErrorBanner(err error, width int) string
- func Height(str string) int
- func IsImageMIME(mime string) bool
- func OpenDataBackground(data []byte, mimeType string) error
- func OpenTempfileEditor(pattern string, content string, placeholder string) tea.Cmd
- func ScrollIntoView(vp *viewport.Model, offset int, edge int)
- func SystemOpener() string
- func TruncateLeftToCellWidth(str string, width int, tail string) string
- func TruncateRightToCellWidth(str string, width int, tail string) string
- func ViewportScrollDir(msg tea.Msg, km viewport.KeyMap) int
- func Width(str string) int
- type MsgTempfileEditorClosed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorBanner ¶
func IsImageMIME ¶
IsImageMIME reports whether the MIME type is an image type supported by LLM APIs.
func OpenDataBackground ¶
OpenDataBackground writes data to a temporary file derived from mimeType and opens it with the system viewer in a background goroutine. The temp file is cleaned up when the viewer exits.
func OpenTempfileEditor ¶
OpenTempfileEditor opens $EDITOR on a temporary file with the given content. Upon closing, the contents of the file are read and returned wrapped in a MsgTempfileEditorClosed
func SystemOpener ¶
func SystemOpener() string
SystemOpener returns the system command used to open files (xdg-open on Linux/BSD, open on macOS).
func TruncateLeftToCellWidth ¶
func ViewportScrollDir ¶
ViewportScrollDir returns -1 if msg would cause the viewport to scroll up, +1 if it would scroll down, and 0 for non-scroll messages. This is used to determine when to pass scroll events through from the confirm viewport to the messages viewport when the confirm viewport is at its boundary.
Types ¶
type MsgTempfileEditorClosed ¶
type MsgTempfileEditorClosed string