pub struct TerminalMode;Implementations§
Source§impl TerminalMode
impl TerminalMode
Trait Implementations§
Source§impl Mode for TerminalMode
impl Mode for TerminalMode
Source§fn target_buffer_kind(&self) -> Option<BufferKind>
fn target_buffer_kind(&self) -> Option<BufferKind>
H.2: terminal buffers (BufferKind::Terminal) dispatch to
this major via the registry’s kind index.
Source§fn invocation_runner(&self) -> Option<ModeId>
fn invocation_runner(&self) -> Option<ModeId>
2026-05-26: claim invocation dispatch for terminal panes.
The host’s runner registry maps terminal-mode to
Editor::run_terminal_invocation; Editor::run_invocation
looks the runner up via this hook instead of branching
on BufferKind::Terminal.
Source§fn kind(&self) -> ModeKind
fn kind(&self) -> ModeKind
Major or minor. Read at registration and on every activation
call (
activate_major on a minor, or vice versa, is
[ModeActivationError::WrongKind]).Source§fn options(&self) -> OptionOverrideSet
fn options(&self) -> OptionOverrideSet
Option overrides this mode contributes. Pure declarative
(same return value every call); the host merges these
into the buffer’s option-resolution layer stack while the mode
is active, at the mode’s layer (later-activated minors win ties),
and drops them on deactivation. Build with
lattice_config::overrides! { lattice_config::Wrap = true, … }.Source§fn required_capabilities(&self) -> CapabilitySet
fn required_capabilities(&self) -> CapabilitySet
Capabilities the mode requires. Validated at activation;
missing capability ⇒
[
ModeActivationError::MissingCapability], never silent
skip.Source§fn on_activate(&self, _ctx: ModeContext) -> LifecycleFuture<'_, ()>
fn on_activate(&self, _ctx: ModeContext) -> LifecycleFuture<'_, ()>
Lifecycle. Called once per (buffer, activation) cycle
after the registry has applied the declarative
contributions. Returns an owned
Guard
carrying every resource the mode allocated. The
dispatcher stashes the Guard until deactivation, at which
point dropping it performs cleanup via the Guard’s Drop
impl. Read more§fn target_language(&self) -> Option<&str>
fn target_language(&self) -> Option<&str>
For major modes, the language this mode is the
default major for, by canonical name (
Lang::name() —
"rust", "org") (OM.1). The peer of
target_buffer_kind for the
dispatch path [BufferKind::Document] takes: language
detection rather than kind dispatch. Read more§fn decorations(&self) -> Vec<DecorationProvider>
fn decorations(&self) -> Vec<DecorationProvider>
Decoration providers (gutter / inline / overlay /
statusline). Stub — reserved for the WIT plugin path (M.10).
§fn gutter_decorations(&self, _ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
fn gutter_decorations(&self, _ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
Gutter sign decorations this mode contributes while active.
Called once per pane per frame with a [
DecorationCtx]
carrying relevant render-state snapshots (diff sign map, LSP
diagnostics arc). Returns per-line GutterDecoration values;
the renderer partitions them by variant into the appropriate
gutter column. Default: empty (no contribution).§fn completion_sources(&self) -> Vec<CompletionSourceContribution>
fn completion_sources(&self) -> Vec<CompletionSourceContribution>
Insert-mode completion sources this mode contributes while
active on a buffer. Empty by default; minors that own a
completion source (
lsp-completion-mode,
snippet-completion-mode, buffer-words-mode,
tree-sitter-completion-mode, path-completion-mode,
plugin sources) override.§fn action_handlers(&self) -> Vec<ActionHandlerContribution>
fn action_handlers(&self) -> Vec<ActionHandlerContribution>
Global (buffer-agnostic) action handlers this
mode contributes (SN.3c.0). The host walks every registered mode’s
action_handlers() once at boot, resolves each
action_name → CommandId, registers the handler in the
ActionHandlerRegistry, and holds the tokens for the app’s
lifetime. Use this for handlers that read the active
buffer / cursor / services from the ActionContext at call
time and close over no per-buffer state (e.g. snippet
expand). Per-buffer, session-scoped handlers register in
on_activate instead, so their tokens
drop with the Guard. Default: none. See
feedback_effect_vocabulary_is_host_boundary.§fn conflicts_with(&self) -> &[ModeId]
fn conflicts_with(&self) -> &[ModeId]
Modes this one cannot be active alongside. Read more
§fn implies(&self) -> &[ModeId]
fn implies(&self) -> &[ModeId]
Minor modes activating this mode also activates.
Used by
relative-line-numbers-mode ⇒ line-numbers-mode, and by
read-only majors ⇒ read-only-mode. Read more§fn presents_extensions(&self) -> &[&'static str]
fn presents_extensions(&self) -> &[&'static str]
File extensions (lowercase, no dot) this major PRESENTS rather than
edits — the file is never loaded as text. Read more
§fn mirrors_option(&self) -> Option<&'static str>
fn mirrors_option(&self) -> Option<&'static str>
Declarative mirror hint for “this mode is the on/off
switch for a typed option of the same observable state”.
Some(canonical_name) ⇒ a host-driven cascade keeps the
mode’s active state and the option’s value in sync.§fn refresh_action(&self) -> Option<&'static str>
fn refresh_action(&self) -> Option<&'static str>
Which of this mode’s own actions refreshes
its view, or
None (the default) when the mode backs nothing
refreshable (RV.1, 2026-08-10). Read more§fn fold_toggle_action(&self) -> Option<&'static str>
fn fold_toggle_action(&self) -> Option<&'static str>
Which of this mode’s actions
<Tab> fires, and the declaration that
pulls in
foldable-view-mode —
the shared minor owning the chord. Read more§fn refresh_on_open(&self) -> bool
fn refresh_on_open(&self) -> bool
Should re-opening this view re-run its refresh? Read more
§fn activation_policy(&self) -> ActivationPolicy
fn activation_policy(&self) -> ActivationPolicy
A minor mode’s default auto-activation policy
(MA.1; mode-architecture.md §7.4). The host’s minor-activation
resolver reads this for every registered minor when a buffer
enters a major mode, and activates those whose policy
admits the entered major. The
default is [ActivationPolicy::Manual] — auto-activate
nowhere until the mode or the user opts in. Ignored for major
modes (a buffer’s major is chosen by the major resolver, not
this allowlist).§fn editable_tail(&self) -> Option<EditableTail>
fn editable_tail(&self) -> Option<EditableTail>
The mode’s editable tail on an otherwise read-only buffer, or
None (the default) for a fully read-only / fully writable buffer
(AU‑3). Read moreAuto Trait Implementations§
impl Freeze for TerminalMode
impl RefUnwindSafe for TerminalMode
impl Send for TerminalMode
impl Sync for TerminalMode
impl Unpin for TerminalMode
impl UnsafeUnpin for TerminalMode
impl UnwindSafe for TerminalMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<M> DynMode for Mwhere
M: Mode,
impl<M> DynMode for Mwhere
M: Mode,
§fn target_buffer_kind(&self) -> Option<BufferKind>
fn target_buffer_kind(&self) -> Option<BufferKind>
Forwards to [
Mode::target_buffer_kind].§fn target_language(&self) -> Option<&str>
fn target_language(&self) -> Option<&str>
Forwards to [
Mode::target_language].§fn decorations(&self) -> Vec<DecorationProvider>
fn decorations(&self) -> Vec<DecorationProvider>
Forwards to [
Mode::decorations].§fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
Forwards to [
Mode::gutter_decorations].§fn completion_sources(&self) -> Vec<CompletionSourceContribution>
fn completion_sources(&self) -> Vec<CompletionSourceContribution>
Forwards to [
Mode::completion_sources].§fn action_handlers(&self) -> Vec<ActionHandlerContribution>
fn action_handlers(&self) -> Vec<ActionHandlerContribution>
Forwards to [
Mode::action_handlers].§fn required_capabilities(&self) -> CapabilitySet
fn required_capabilities(&self) -> CapabilitySet
Forwards to [
Mode::required_capabilities].§fn conflicts_with(&self) -> &[ModeId]
fn conflicts_with(&self) -> &[ModeId]
Forwards to [
Mode::conflicts_with].§fn presents_extensions(&self) -> &[&'static str]
fn presents_extensions(&self) -> &[&'static str]
Forwards to [
Mode::presents_extensions].§fn mirrors_option(&self) -> Option<&'static str>
fn mirrors_option(&self) -> Option<&'static str>
Forwards to [
Mode::mirrors_option].§fn invocation_runner(&self) -> Option<ModeId>
fn invocation_runner(&self) -> Option<ModeId>
Forwards to [
Mode::invocation_runner].§fn refresh_action(&self) -> Option<&'static str>
fn refresh_action(&self) -> Option<&'static str>
Forwards to [
Mode::refresh_action].§fn fold_toggle_action(&self) -> Option<&'static str>
fn fold_toggle_action(&self) -> Option<&'static str>
Forwards to [
Mode::fold_toggle_action].§fn refresh_on_open(&self) -> bool
fn refresh_on_open(&self) -> bool
Forwards to [
Mode::refresh_on_open].§fn activation_policy(&self) -> ActivationPolicy
fn activation_policy(&self) -> ActivationPolicy
Forwards to [
Mode::activation_policy].§fn editable_tail(&self) -> Option<EditableTail>
fn editable_tail(&self) -> Option<EditableTail>
Forwards to [
Mode::editable_tail].§fn on_activate_dyn<'a>(
&'a self,
ctx: ModeContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>, ModeActivationError>> + Send + 'a>>
fn on_activate_dyn<'a>( &'a self, ctx: ModeContext, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>, ModeActivationError>> + Send + 'a>>
Type-erased lifecycle entry. Returns a future whose
output is the typed Guard erased to
Box<dyn Any + Send>.
The dispatcher stashes this box keyed by
(BufferId, ModeId); deactivation drops it.