pub enum ArgDefault {
Required,
None,
Literal(ArgValue),
UseSelection,
UseCursorWord,
UseLastResponse,
}Expand description
What the runtime should fall back to when an arg is unsupplied at
invocation time (DESIGN.md §B.1). For interactive entry, the fallback
chain is: caller-supplied value -> default -> prompt the user.
What the host acts on today: Required on an ex-command’s first arg
arms the cmdline missing-arg prompt when the command is run bare, and
Literal fills unset slots when a transient projects its state into
Args. The Use* variants are declared and rendered by
:describe-command, but nothing resolves them yet – a command that
declares one must still cope with the arg being absent.
Variants§
Required
No fallback – the runtime prompts (or errors, in non-interactive callers) when this arg is missing.
None
Optional. Missing means “absent”; the apply closure must handle the absence gracefully.
Literal(ArgValue)
A literal default value.
UseSelection
Use the current visual selection’s text. Useful for :s invoked
over a visual range: the default pattern is “the selected text”.
UseCursorWord
Use the word under the cursor. Useful for :grep-style commands.
UseLastResponse
Use the most recently entered value of this argument. Useful for
:s to default to the previous pattern + replacement.
Trait Implementations§
Source§impl Clone for ArgDefault
impl Clone for ArgDefault
Source§fn clone(&self) -> ArgDefault
fn clone(&self) -> ArgDefault
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more