Expand description
Foundation modes that ship with lattice-mode.
Includes the catch-all TextMode plus the modes that
are genuinely foundational or shared across many features
(help-mode, hover-mode). Per the rule of thumb – “a
mode lives with the crate that owns its associated feature”
– modes for feature crates live with their crate:
- Language modes (
rust-mode,markdown-mode, …) live inlattice-syntax. - LSP log modes + the
lsp-modeumbrella + its sub-modes live inlattice-lsp. oil-modelives inlattice-oil.file-tree-modelives inlattice-file-tree.
Exceptions kept here:
TextMode– the catch-all major when no language matches; foundational, no owning feature crate.HelpMode– shared across:help,:describe-*,:apropos,:keymap,:options,:customize. Many features compose with it; living under any one of those crates would be arbitrary.HoverMode– shared across LSP hover, signature help, future diagnostic-at-cursor popups.- Display minor modes (
line-numbers-mode,wrap-mode, …) – renderer-agnostic; they contribute typed options that the renderer reads, no owning feature crate.
All modes registered here self-register at App boot via
register_foundation_modes. Feature-crate modes have
their own register_<X>_modes entry point that the App’s
boot path calls alongside this one.
Re-exports§
pub use completion::ActiveCompletionSources;pub use completion::BufferWordsMode;pub use completion::CompletionMode;pub use completion::CompletionPopupMode;pub use completion::PathCompletionMode;pub use display::CurrentLineHighlightMode;pub use display::LineNumbersMode;pub use display::ReadOnlyMode;pub use display::RelativeLineNumbersMode;pub use display::WhitespaceShowMode;pub use display::WrapMode;pub use help::HelpMode;pub use help::register_help_mode_actions;pub use hover::HoverMode;pub use image::ImageFileMediaSource;pub use image::ImageMode;pub use image::is_image_path;pub use image::register_image_media_source;pub use messages::MessagesMode;pub use text::TextMode;pub use which_key::WhichKeyGrid;pub use which_key::WhichKeyMode;pub use which_key::install as install_which_key;pub use which_key::wire as wire_which_key;
Modules§
- completion
- Completion-mode pair (insert-completion.md §12).
- display
- Display minor modes – thin user-toggleable wrappers around the typed display options that already shipped (DESIGN.md §5.12 + mode-architecture.md §4.2.2 / M.7).
- help
help-mode– minor mode that turns a markdown buffer into a help buffer (DESIGN.md §5.11). Composes withmarkdown-mode(the major), which carries the syntax pipeline + motion semantics. Help-mode adds:- hover
hover-mode– minor mode activated on the hover popup buffer (M.4 hover-popup unification). Marker mode for v1; the only behaviour gated on it today is the State-A auto-dismiss-on- doc-cursor-motion check in the App’s dispatch loop. Future hover-only contributions (auto-close timer, bound-<Esc>-to- dismiss, signature-help fan-in) layer on without touching the popup-overlay code.- image
image-mode— the major mode for a buffer whose file is a picture.- messages
messages-mode– major mode for the editor’s*messages*audit-log buffer (design.md §5.10.6).- surround
- surround-mode – vim-surround semantics as a native minor mode.
- table
- Markdown / org table support.
- text
text-mode– the default major mode for plain-text content.- which_
key - Which-key — the pending-chord discoverability subsystem.
Functions§
- register_
foundation_ modes - Register every foundation mode against
registry. Called from the App’s mode-registry boot path before any buffer is created.