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.
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
impl Clone for HelpLinkTarget
Source§fn clone(&self) -> HelpLinkTarget
fn clone(&self) -> HelpLinkTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HelpLinkTarget
impl Debug for HelpLinkTarget
impl Eq for HelpLinkTarget
Source§impl PartialEq for HelpLinkTarget
impl PartialEq for HelpLinkTarget
impl StructuralPartialEq for HelpLinkTarget
Auto Trait Implementations§
impl Freeze for HelpLinkTarget
impl RefUnwindSafe for HelpLinkTarget
impl Send for HelpLinkTarget
impl Sync for HelpLinkTarget
impl Unpin for HelpLinkTarget
impl UnsafeUnpin for HelpLinkTarget
impl UnwindSafe for HelpLinkTarget
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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)
&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)
&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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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