Skip to main content

HelpLinkTarget

Enum HelpLinkTarget 

Source
pub enum HelpLinkTarget {
    Command(String),
    Chord(String),
    Source {
        path: PathBuf,
        line: u32,
    },
    Topic(String),
    Anchor(String),
    Execute(String),
    Customize(String),
    CustomizeEdit(String),
    Mode(String),
    Url(String),
    Unresolved(String),
}
Expand description

What a [[…]] link points at. Renderers / link-following motions dispatch on this.

Variants§

§

Command(String)

[[command:NAME]] – re-dispatches :describe-command NAME.

§

Chord(String)

[[key:CHORD]] – re-dispatches :describe-key CHORD.

§

Source

[[file:PATH:LINE]] – opens PATH at LINE.

Fields

§path: PathBuf
§line: u32
§

Topic(String)

[[help:TOPIC]] – re-dispatches :help TOPIC. Used by :describe-* cross-references and by topic body content itself so a topic can link to a sibling topic.

§

Anchor(String)

[label](#slug) – intra-document jump. Auto-generated from markdown headings (GitHub-style slug: lowercase, non-alnum runs collapsed to -, leading/trailing - trimmed). The follow-link handler scrolls the current help buffer to the matching anchor’s line; no buffer swap.

§

Execute(String)

[label](exec:CMDLINE) – executes the cmdline as if the user had typed :CMDLINE<CR>. Distinct from Self::Command which describes the command instead of running it. Used by picker-style help buffers (e.g. :lsp-server-log) where each row’s link should fire the real command on Enter, not surface its docs.

The payload is the full cmdline (command + args, no leading colon). Multi-arg commands like lsp-log rust pass through verbatim.

§

Customize(String)

[label](customize:NAME) – re-dispatches :customize NAME (M.9.1). Used by the customize picker so each group / mode row in the no-args view follows to its own focused buffer on <CR>.

§

CustomizeEdit(String)

[label](customize-edit:NAME) – prefills the cmdline with :set NAME=<current-value> and enters Command mode (M.9.2). Used by the customize buffer’s per-row links so <CR> on an option row opens an inline edit. The actual write goes through the existing :set machinery, so validation, cascade, and event-bus publishing all run unchanged.

§

Mode(String)

[label](mode:NAME) – re-dispatches :describe-mode NAME. Used by :describe-buffer (the “modes active here” section) so each mode name in the list is clickable; follow-link pushes a position-history entry so <C-o> walks back into the originating help buffer.

§

Url(String)

[label](URL) where URL carries a real network / app scheme (http://, https://, mailto:, or any scheme://… such as slack://, vscode://). Follow-link hands it to the OS handler (open / xdg-open / explorer) so the default browser / app opens it. Distinct from Self::Source (file: → open in-editor) and Self::Unresolved (no handler).

§

Unresolved(String)

[[…]] whose payload didn’t match a known scheme. Preserved verbatim for forward-compat – a plugin / future scheme can inspect the raw payload.

Trait Implementations§

Source§

impl Clone for HelpLinkTarget

Source§

fn clone(&self) -> HelpLinkTarget

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 HelpLinkTarget

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for HelpLinkTarget

Source§

impl PartialEq for HelpLinkTarget

Source§

fn eq(&self, other: &HelpLinkTarget) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HelpLinkTarget

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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