Summary
Terminal.Gui.TextView exposes control-level Load(string path), Load(Stream), Load(List<Cell>…), and CloseFile(). The naive case (File.ReadAllText → Document.Text) is trivial helper territory and stays a consumer concern. The streaming / large-file path is not trivial and is a real gap: loading a multi-MB file without materializing the whole string, and the async placement question.
This is the recognized open question specs/decisions.md OPEN-003 ("LoadAsync(Stream) / SaveAsync on Editor vs. on the document"). Editor is intended to functionally replace TextView, and the beta bar already calls for large-file responsiveness (10 MB < 200 ms initial render), so streaming load deserves a tracked decision + implementation.
Scope
- Resolve OPEN-003: does
LoadAsync(Stream) / SaveAsync live on Editor, on TextDocument, or both (control delegates to document)? The rope-backed TextDocument / RopeTextSource is the natural streaming seam.
- Streaming load that does not allocate the entire file as one
string; encoding/BOM + line-ending preservation per DEC-001.
SaveAsync round-trips byte-identical except edited lines (DEC-001).
- Cancellation + progress for very large files; initial render must not block on full load (meets the beta large-file bar).
examples/ted uses the streaming load path for File → Open (R9). - Ted should have a progress indicoatr in the stastus bar showing the async loading status.
Definition of done
Refs: specs/textview-parity-gap/spec.md Gap 6, specs/decisions.md OPEN-003, DEC-001; specs/plan.md Beta Definition of Done (large-file).
🤖 Generated with Claude Code
Summary
Terminal.Gui.TextViewexposes control-levelLoad(string path),Load(Stream),Load(List<Cell>…), andCloseFile(). The naive case (File.ReadAllText→Document.Text) is trivial helper territory and stays a consumer concern. The streaming / large-file path is not trivial and is a real gap: loading a multi-MB file without materializing the whole string, and the async placement question.This is the recognized open question
specs/decisions.mdOPEN-003 ("LoadAsync(Stream)/SaveAsynconEditorvs. on the document"). Editor is intended to functionally replaceTextView, and the beta bar already calls for large-file responsiveness (10 MB < 200 ms initial render), so streaming load deserves a tracked decision + implementation.Scope
LoadAsync(Stream)/SaveAsynclive onEditor, onTextDocument, or both (control delegates to document)? The rope-backedTextDocument/RopeTextSourceis the natural streaming seam.string; encoding/BOM + line-ending preservation per DEC-001.SaveAsyncround-trips byte-identical except edited lines (DEC-001).examples/teduses the streaming load path forFile → Open(R9). - Ted should have a progress indicoatr in the stastus bar showing the async loading status.Definition of done
specs/decisions.mdOPEN-003 resolved and logged (placement decided).LoadAsync/SaveAsyncimplemented at the decided layer; no full-file string materialization on load.specs/file-io/spec.md;specs/public-api.mdupdated (R8).dotnet format+jbclean.Refs:
specs/textview-parity-gap/spec.mdGap 6,specs/decisions.mdOPEN-003, DEC-001;specs/plan.mdBeta Definition of Done (large-file).🤖 Generated with Claude Code