Skip to main content

Module messages

Module messages 

Source
Expand description

messages-mode – major mode for the editor’s *messages* audit-log buffer (design.md §5.10.6).

Single buffer in the editor (*messages*). The mode’s job is small but architecturally important:

  • Identity: the buffer’s major mode IS messages-mode, not text-mode + read-only-mode. Symmetric with lsp-log-mode for *lsp*. The renderer can branch on messages-mode if it ever needs to (today it doesn’t).
  • Read-only contribution: the mode contributes ReadOnly = true so the modal dispatcher gates user keystrokes; subsystem writes bypass via apply_edit_batch_blocking.
  • Future home for the tracing-subscriber lifecycle (deferred to v1.1). msg-mode.1 installs the global subscriber once at App boot; making the subscriber’s enable/disable mode-driven is a refinement that lives in the mode’s Guard once it lands.

Marker mode for v1: type Guard = ();, trivial on_activate. The work the spec attributes to “registers a tracing::Subscriber at activate time” is split across the App boot path (lattice_runtime::install_messages_subscriber) for v1 simplicity. The mode-driven lifecycle binding lands when reload-based subscriber control is wired in v1.1.

Structs§

MessagesMode
Major mode for the *messages* buffer.

Functions§

buffer_spans
line_spans for a whole buffer, one entry per line.
line_spans
Syntax-highlight one *messages* line.