Skip to main content

PickerAcceptOutcome

Enum PickerAcceptOutcome 

Source
pub enum PickerAcceptOutcome {
Show 19 variants OpenFile { path: PathBuf, }, SwitchBuffer { buffer_id: u32, }, JumpInBuffer { buffer_id: u32, line: u32, col: u32, }, JumpToMark { name: char, }, JumpToLocation { path: PathBuf, line: u32, col: u32, }, InvokeCommand { id: String, args: Args, }, PasteRegister { name: char, }, ExpandSnippet { id: String, }, OpenLspLog { server_id: String, }, OpenLspTraceLog { server_id: String, }, ApplyLspCodeAction { handle: u64, index: u32, }, ApplyLspCompletion { index: u32, }, ApplyColorscheme { name: String, }, LoadCommandLine { text: String, }, LoadSearchLine { text: String, }, WalkPaneHistory { index: u32, }, OpenPrompt { prompt: String, initial: String, on_submit_action: String, buffer_name: Option<String>, }, FillCaller { text: String, }, NoOp,
}
Expand description

Result of PickerSourceGenerator::accept. The host pattern-matches and runs the corresponding mutation.

New variants are added when (and only when) a concrete picker source needs an action the existing set can’t express. Resist re-using Effect directly: a tighter outcome set is easier to audit, easier to mirror in WIT, and stops source generators from emitting arbitrary grammar effects that bypass picker conventions.

Variants§

§

OpenFile

Edit the file at path. Host routes through App::do_edit, which handles the “already-open” + new-file branches uniformly.

Fields

§path: PathBuf
§

SwitchBuffer

Switch the active pane to an existing buffer by id.

Fields

§buffer_id: u32
§

JumpInBuffer

Move the cursor within buffer_id. If buffer_id is the active pane’s buffer, only the cursor moves; otherwise the host activates that buffer first. Picker sources use this for in-buffer jumps where the buffer is already loaded (:picker lines, :picker marks against the active doc).

Fields

§buffer_id: u32
§line: u32
§col: u32
§

JumpToMark

Jump to a named mark. The host resolves the mark’s position itself – the source doesn’t need to.

Fields

§name: char
§

JumpToLocation

Jump to path:line:col. If path isn’t the active buffer, the host opens it first. Used by LSP locations, grep hits, outline jumps – anywhere the destination might or might not already be open.

Fields

§path: PathBuf
§line: u32
§col: u32
§

InvokeCommand

Dispatch an ex-command by id with the provided args. The command palette (:picker commands) uses this; future plugin sources may emit it for chained behaviors (“pick a thing, then run a command on it”).

Fields

§args: Args
§

PasteRegister

Paste a register’s contents at the current cursor. name is the single-char register identifier (a-z, 0-9, ", +, etc.).

Fields

§name: char
§

ExpandSnippet

Expand a snippet by id at the current cursor.

Fields

§

OpenLspLog

Open the per-server LSP log buffer.

Fields

§server_id: String
§

OpenLspTraceLog

Open the per-server LSP trace-log buffer (distinct from the regular log; carries the protocol trace).

Fields

§server_id: String
§

ApplyLspCodeAction

Apply a resolved LSP code action by index into the host’s pending_code_action_items snapshot. handle is the cancellation token / request handle the action was registered against (carried by the host for resolve-then-apply correlation).

Fields

§handle: u64
§index: u32
§

ApplyLspCompletion

Apply an LSP completion item by index into the host’s pending_completion_items snapshot.

Fields

§index: u32
§

ApplyColorscheme

T.12: apply the named theme via the ThemeRegistry catalog; host calls apply_theme + signals ThemeChanged. Emitted by the colorscheme picker on both accept and live preview.

Fields

§name: String
§

LoadCommandLine

MB.3: load text into the editable : command line WITHOUT executing it. Host routes through Editor::open_command_line, exactly as if the user had typed : and the text by hand — they then tweak (or <C-x><C-e> expand) and <CR> to run. Emitted by the history picker source (q: / :history).

Fields

§text: String
§

LoadSearchLine

MB.5: load text into the editable / search line WITHOUT executing it. Host routes through Editor::open_search_line (Forward direction) + set_search_line_text — the user tweaks and <CR> to execute. Emitted by the search-history picker source (q/ / q? / :history search).

Fields

§text: String
§

WalkPaneHistory

PBH.5: walk the active pane’s buffer trail to index — a MOVE of the walk position, not a new visit, so the forward tail stays reachable. Host routes through Editor::do_pane_history_jump. Emitted by the pane-buffer-history source; host-internal (a plugin has no pane trail to name).

Its own variant rather than NoOp-plus-host-fallback: the source used to return NoOp expecting the legacy routing arm to do the walk, but a registered generator’s outcome is applied INSTEAD of that arm, so <CR> closed the picker and went nowhere.

Fields

§index: u32
§

OpenPrompt

Open a generic one-line minibuffer text prompt — picker-accept’s peer of Effect::OpenPrompt (same fields, same name-based on_submit_action lookup, no closures). Lets a source chain “pick an item, then type a value” (e.g. magit’s branch-create: pick the base branch via this picker, then prompt for the new branch’s name) without inventing bespoke per-source plumbing. buffer_name, when set, stashes context (e.g. the picked base branch) in the prompt buffer’s synthetic name for the submit handler to read back.

Fields

§prompt: String
§initial: String
§on_submit_action: String
§buffer_name: Option<String>
§

FillCaller

YR.3 / MG.53.e: the picked item’s text, for whatever opened the picker.

The outcome for a source that answers a question rather than performing an action. Where the text lands is not the source’s business and not encoded here — the host consumes the FillTarget it captured when the picker was opened. The same file-pick list fills a magit argument; the same yank-ring list fills the document, the : line, a prompt, or another picker’s query.

Deliberately not InvokeCommand. A source that supplies text does not know, and must not decide, what the text is for. Baking a command into the source would mean one registered source per consumer, which is the duplication this exists to avoid.

The host echoes and drops it when no target was captured; text arriving with nowhere to go is a wiring bug, not a user error, and silently discarding it would present as a picker that does nothing.

Fields

§text: String
§

NoOp

Picker dismissed without action – source-side abort, accept-on-empty filter, etc. Host applies no mutation. Distinct from Err returned from accept (which echoes an error message); NoOp is the silent “nothing to do here” path.

Trait Implementations§

Source§

impl Clone for PickerAcceptOutcome

Source§

fn clone(&self) -> PickerAcceptOutcome

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PickerAcceptOutcome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more