Documentation
¶
Overview ¶
Package edit implements Cmd-K-style inline AI edits. The pane wraps a short prompt for the model and streams the result back as a diff preview. One pane edits one line at a time; selection ranges are a follow-up.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptMsg ¶
type AcceptMsg struct {
Path string
Line int // 0-based line number to replace
NewText string // proposed replacement line
}
AcceptMsg is emitted when the user accepts the proposed edit. Host inserts NewText at the original line.
type CancelMsg ¶
type CancelMsg struct{}
CancelMsg means the user dismissed the pane without applying.
type Pane ¶
type Pane struct {
// contains filtered or unexported fields
}
Pane is the immutable model for the inline edit overlay.
func NewPane ¶
NewPane constructs an empty pane. The client may be nil; in that case the pane shows a status message instead of streaming.
func (Pane) Open ¶
Open targets a (path, line) pair. The pane resets prompt+proposed and returns to StateComposing.
func (Pane) Proposed ¶
Proposed returns the current proposed text (may be partial during streaming).
type SubmittedMsg ¶
type SubmittedMsg struct{}
SubmittedMsg is fired internally when the user presses Enter from StateComposing. The host doesn't need to react to this.