Expand description
The editor state: modes, pending keys, named registers, buffers.
One input path for TUI and headless — both call feed.
Mode handlers live beside this file: normal, visual, insert.
Re-exports§
pub use remote::RemoteEvent;pub use remote::RemoteView;pub use resolution::ResolutionEvent;pub use resolution::ResolutionState;
Modules§
- block
- Visual rectangles share streamed cell geometry with rendering. Partial wide clusters become spaces; complete tabs retain their bytes in the register.
- events
- The unified event source (0018 §services): every async producer —
terminal, LSP, git, shell, picker, clipboard — lands on ONE channel
as a typed
AppEvent. The main loop parks on it; workers wake the loop the instant they post. Gone: the 500ms poll latency between a job finishing and the UI noticing. - io
- File I/O is owned work. Only matching completions may publish into a view.
- keys
- Streaming script-token decoding shared by Editor::feed_text and headless. Unknown tokens stay literal, and a lone ‘<’ never fabricates a closing ‘>’.
- macros
- Macros (0016 §macros):
q{reg}records raw key events,@{reg}replays them — replay feeds keys back through the ONE input machine, so a macro is exactly as capable as hands on the keyboard. Counts work (3@a),@@repeats the last replay. - pending
- One owner for modal input (R7). A text prompt —
:ex,/search,?search,|pipe— owns itsLineEditplus everything about the moment it opened: the pane (full selections and viewport), the document and its revision. Structural operator composition stays in theWalker; prompts never fabricate grammar text. - remote
- Editor-side remote workspace ownership. Transport actors live in strop-remote; this module owns view intent, periodic reads, explicit connections and browsing.
- resolution
- Bounded input work: large grammar reads run on one CPU owner. Input after an accepted command stays ordered; Ctrl-C revokes it. Preview and execution use the same revision/cursor/command-stamped pure resolver result.
- trace
- Editor-specific producers and the forensic replay driver. Storage and ordering belong to strop-trace.
- transact
- A mutation lease is the publication boundary, independent of undo grouping.
- view
- Viewport motions and the jump-back cluster (the vim canon wave):
Ctrl-d/u/f/bscroll,zz/zt/zb+H/M/Lviewport placement,ZZwrite-quit,Ctrl-^alternate buffer,gv/gire-entry,g;/g,the change list. Viewport geometry comes fromscroll_to_cursor, which the render loop feeds every frame — the pane’sview_rowsis the editor’s single source of truth for “how tall is the screen”.
Structs§
- Attach
Record - The serializable outcome of one attach attempt. Refusals carry
server: None; a spawned (or replayed) server keeps its identity. - Blame
Gutter - Per-buffer blame gutter state (0011 §3), keyed by canonical path — no parallel vector to keep aligned, and index churn can never pair one buffer with another’s blame. Valid only while the buffer’s revision and line count still match the capture.
- Block
Rect - The ctrl-v rectangle (0017): line span by buffer index, cell span by LineLayout columns — named fields, not a naked mixed-unit tuple.
- Clipboard
Key - The document that asked for a clipboard read (R9): the terminal result owns this ticket — a paste lands only in the buffer that requested it, and failures surface instead of collapsing into “empty clipboard”.
- Commit
Files - The commit a Diff surface’s file belongs to, with the commit’s full
changed-file list — the sidebar’s data (typed numstat rows, the same
ones the changed-files surface renders from; 0011 §4).
repois the provenance the whole delta chain replays:]fsteps and dives from this surface run against that repository — remote surfaces never answer from the local cwd (0036 RW8). - Container
Key - Document
- One document: the text buffer plus everything that used to live in parallel vectors keyed by buffer index (0014 wave 2). One struct, one arena — the alignment invariant is the type system now.
- Document
Diagnostics - Editor
- Find
Pending - A pending
f/F/t/Tawaiting its target char — the leap-style candidate overlay’s input. Named fields, not a naked(u8, bool). - Last
Search - The compiled query owns matching semantics for repeat, preview and highlighting.
- LspServer
- Pane
- One pane: the document it shows plus its own view state.
- Pending
Permalink - Frozen pure data for a permalink whose SSH host alias is still unresolved: the alias’s answer plus these fields rebuild the URL with no repository handle, no IO, and no state that moved meanwhile. The captured repository determines which machine and working directory own the OpenSSH configuration (0036 RW8).
- Picker
Glue - Prepared
Diff - Prepared
Files - Preview
Key - One supervised preview read: the picker instance it serves and the native path being read.
- Ranking
Event - Register
- One register cell: text + shape (vim’s unnamed register is
"). - Remote
Completion Key - The typed moment a request owns; every delivery re-checks it.
- Remote
Directory - Remote
Document - Shell
Intent - Sidebar
- The immutable commit tree; native filenames stay in its owning file list.
- Workspace
Registry
Enums§
- Container
Result - One job’s terminal answer.
- DiffRow
- One canonical row projection shared by rendering and source navigation.
- Document
Source - What backs a document. Derived facts (readonly, save refusal) come from this, not from fields callers must keep in sync.
- GitJob
- Results from git workers; the event loop (or headless drain) routes each to its handler. Every variant owns its ticket — there is no unowned error path (R9).
- Key
- Layout
Dir - v1 is a flat layout: Row = vertical splits side by side, Column = horizontal splits stacked.
- Mode
- Preview
Source - Remote
Completion Result - The worker’s terminal answer. Failures travel as
Outcome::Failed; this carries only successes. - Shell
Key - Which surface owns a shell request, captured at registration and never re-derived from current editor state at delivery.
- Sidebar
Row - One sidebar row in tree form (zed-lite: always-expanded, directory rows dim and shallow, files indented by depth).
- Surface
Constants§
Functions§
- git_
channel - The git job channel ends (created once in
Editor::new). - state_
json - The headless
statedirective’s logical observation (0006): mode, cursor, pending input, picker and register state — no cells. The binary’s headless driver prints it; the forensic observation embeds it.
Type Aliases§
- Clipboard
Result - The owned terminal clipboard-read result.
- Frame
Draw - The injected frame renderer’s shape (0046): editor, columns, rows, record-action flag — the binary’s implementation renders via TestBackend.
- Preview
Result - The terminal result of a preview request.
- Previews
- Shell
Result - The owned terminal shell result: one per registered request.