Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Helix: Orientation

Terminal editorTokio applicationRevision 079a789

Helix is a modal editor built around one strong ownership decision: the editor state is mutated in one foreground event loop, while I/O and other waiting work run asynchronously and return results to that loop.

The architectural center

terminal event ─┐
LSP message ────┼→ Application::event_loop → &mut Editor + &mut Compositor → render
timer/redraw ───┤                    ↑
job callback ───┘          async Job returns closure

command → Transaction → Document → Rope + selections + history + LSP change

Design thesis

Helix permits background work to run concurrently but reserves all visible editor mutation for one foreground loop; jobs return owned results and a one-use instruction for applying them.

  • &mut Editor marks the single mutation authority.
  • Async jobs capture snapshots instead of borrowing foreground state.
  • Version checks distinguish completion from continued relevance.
  • Transactional edits update text and dependent coordinates together.

The important code is spread across deliberately narrow crates:

  • helix-core supplies ropes, selections, transactions, syntax, and editing primitives;
  • helix-view owns documents, views, the editor model, and external-service registries;
  • helix-term owns the application loop, commands, jobs, compositor, and terminal UI;
  • helix-lsp owns JSON-RPC transport and language-server processes;
  • helix-event supplies redraw, status, hook, cancellation, and debounce machinery.

What we will preserve

The reconstruction preserves transactional edits, a layered compositor, a single mutation authority, concurrent background jobs that return callbacks, coalesced redraws, stale-result checks, and bounded shutdown. It does not need tree-sitter, every modal command, real LSP, themes, or terminal escape handling.