pub struct OilMode;Expand description
Major mode for oil-style directory-listing buffers. Any
buffer whose major is oil-mode is an OilBuffer; the
renderer dispatches accordingly.
Implementations§
Trait Implementations§
Source§impl Mode for OilMode
impl Mode for OilMode
Source§fn target_buffer_kind(&self) -> Option<BufferKind>
fn target_buffer_kind(&self) -> Option<BufferKind>
H.2: oil buffers (BufferKind::Oil) 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 oil panes via
Editor::run_oil_invocation.
Source§fn action_handlers(&self) -> Vec<ActionHandlerContribution>
fn action_handlers(&self) -> Vec<ActionHandlerContribution>
LM.3: the navigation/open chord bodies, mode-owned (they were the
host’s do_oil_follow / do_oil_navigate_up + the BufferKind::Oil
input-gate). Each reads the oil buffer’s dir + snapshot from the
ActionContext’s buffer-locals (LM.1) and the entry under the cursor,
then hands the host an Effect (the diff-mode pattern): the mode owns
the decision, the host owns the apply. Bound globally at boot by
register_mode_action_handlers — oil-mode can be active on many
buffers at once, and each handler names its own view
(ctx.buffer_id), so many oil buffers stay independent (design §3.2).
Source§fn kind(&self) -> ModeKind
fn kind(&self) -> ModeKind
activate_major on a minor, or vice versa, is
[ModeActivationError::WrongKind]).Source§fn required_capabilities(&self) -> CapabilitySet
fn required_capabilities(&self) -> CapabilitySet
ModeActivationError::MissingCapability], never silent
skip.Source§fn on_activate(&self, _ctx: ModeContext) -> LifecycleFuture<'_, ()>
fn on_activate(&self, _ctx: ModeContext) -> LifecycleFuture<'_, ()>
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>
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 options(&self) -> OptionOverrideSet
fn options(&self) -> OptionOverrideSet
lattice_config::overrides! { lattice_config::Wrap = true, … }.§fn decorations(&self) -> Vec<DecorationProvider>
fn decorations(&self) -> Vec<DecorationProvider>
§fn gutter_decorations(&self, _ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
fn gutter_decorations(&self, _ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
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>
lsp-completion-mode,
snippet-completion-mode, buffer-words-mode,
tree-sitter-completion-mode, path-completion-mode,
plugin sources) override.§fn conflicts_with(&self) -> &[ModeId]
fn conflicts_with(&self) -> &[ModeId]
§fn implies(&self) -> &[ModeId]
fn implies(&self) -> &[ModeId]
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]
§fn mirrors_option(&self) -> Option<&'static str>
fn mirrors_option(&self) -> Option<&'static str>
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>
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>
<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
§fn activation_policy(&self) -> ActivationPolicy
fn activation_policy(&self) -> ActivationPolicy
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>
None (the default) for a fully read-only / fully writable buffer
(AU‑3). Read moreAuto Trait Implementations§
impl Freeze for OilMode
impl RefUnwindSafe for OilMode
impl Send for OilMode
impl Sync for OilMode
impl Unpin for OilMode
impl UnsafeUnpin for OilMode
impl UnwindSafe for OilMode
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
§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>
Mode::target_buffer_kind].§fn target_language(&self) -> Option<&str>
fn target_language(&self) -> Option<&str>
Mode::target_language].§fn decorations(&self) -> Vec<DecorationProvider>
fn decorations(&self) -> Vec<DecorationProvider>
Mode::decorations].§fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
Mode::gutter_decorations].§fn completion_sources(&self) -> Vec<CompletionSourceContribution>
fn completion_sources(&self) -> Vec<CompletionSourceContribution>
Mode::completion_sources].§fn action_handlers(&self) -> Vec<ActionHandlerContribution>
fn action_handlers(&self) -> Vec<ActionHandlerContribution>
Mode::action_handlers].§fn required_capabilities(&self) -> CapabilitySet
fn required_capabilities(&self) -> CapabilitySet
Mode::required_capabilities].§fn conflicts_with(&self) -> &[ModeId]
fn conflicts_with(&self) -> &[ModeId]
Mode::conflicts_with].§fn presents_extensions(&self) -> &[&'static str]
fn presents_extensions(&self) -> &[&'static str]
Mode::presents_extensions].§fn mirrors_option(&self) -> Option<&'static str>
fn mirrors_option(&self) -> Option<&'static str>
Mode::mirrors_option].§fn invocation_runner(&self) -> Option<ModeId>
fn invocation_runner(&self) -> Option<ModeId>
Mode::invocation_runner].§fn refresh_action(&self) -> Option<&'static str>
fn refresh_action(&self) -> Option<&'static str>
Mode::refresh_action].§fn fold_toggle_action(&self) -> Option<&'static str>
fn fold_toggle_action(&self) -> Option<&'static str>
Mode::fold_toggle_action].§fn refresh_on_open(&self) -> bool
fn refresh_on_open(&self) -> bool
Mode::refresh_on_open].§fn activation_policy(&self) -> ActivationPolicy
fn activation_policy(&self) -> ActivationPolicy
Mode::activation_policy].§fn editable_tail(&self) -> Option<EditableTail>
fn editable_tail(&self) -> Option<EditableTail>
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>>
Box<dyn Any + Send>.
The dispatcher stashes this box keyed by
(BufferId, ModeId); deactivation drops it.