Documentation
¶
Index ¶
- func CleanBuffers(dir string, activePaneIDs []string) error
- func DeleteNotes(dir, paneID string) error
- func Load(path string) (map[string]any, error)
- func LoadBuffer(dir, paneID string) ([]byte, error)
- func LoadNotes(dir, paneID string) (string, error)
- func NotesFileName(paneID string) (string, error)
- func NotesPath(dir, paneID string) (string, error)
- func Save(path string, state map[string]any) error
- func SaveAllBuffers(dir string, buffers map[string][]byte) error
- func SaveBuffer(dir, paneID string, data []byte) error
- func SaveNotes(dir, paneID, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanBuffers ¶
CleanBuffers removes buffer files for panes that no longer exist.
func DeleteNotes ¶
DeleteNotes removes a pane's notes file. Missing files are not an error.
func Load ¶
Load reads workspace state from a JSON file. Falls back to path.bak if the primary file is missing or corrupt. Returns nil, nil if neither file exists (fresh workspace).
func LoadBuffer ¶
LoadBuffer reads a pane's saved output buffer from disk. Returns nil, nil if the file doesn't exist.
func LoadNotes ¶
LoadNotes reads the notes content for a pane from dir. Returns an empty string when no notes file exists, or when the notes directory is missing/not yet created. Refuses to follow symlinks so an attacker who plants a symlink in the notes directory cannot trick the editor into reading another file.
func NotesFileName ¶
NotesFileName returns the sanitized filename for a pane's notes file. The pane ID must not contain any path separators, path traversal tokens, Windows reserved device names, or other special characters.
func Save ¶
Save writes workspace state as JSON to path atomically. The previous file is renamed to path.bak for rollback.
func SaveAllBuffers ¶
SaveAllBuffers writes all pane buffers to disk (best-effort). Returns the first error encountered but continues saving remaining buffers.
func SaveBuffer ¶
SaveBuffer writes a pane's output buffer to a file atomically.
Types ¶
This section is empty.