pub enum CommandLineSlot {
CommandName {
prefix: String,
replace_start: usize,
},
Arg {
command_name: String,
arg_index: usize,
arg_spec: ArgSpec,
prefix: String,
replace_start: usize,
},
BeyondSchema {
command_name: String,
},
DelimiterBody {
command_name: String,
body: String,
},
UnknownCommand {
word: String,
replace_start: usize,
},
Empty,
}Expand description
What the cursor on the : line is pointing at.
Variants§
CommandName
Cursor is in (or right after) the command name. The
completion source is conventionally gen:commands.
Fields
Arg
Cursor is in the N-th positional arg of the resolved
command. arg_spec is the schema entry; command_name is
the canonical registry name (so the host can re-look-up if
it needs to).
BeyondSchema
Cursor is past the schema’s declared args (e.g. extra trailing whitespace on a no-arg command). No completion.
DelimiterBody
Cursor is on a delimiter-syntax command body
(:s/pattern/replacement/flags, :g/pattern/body). v1
returns this without slot specifics; the cmdline parser may
special-case if it wants to (e.g. complete commands inside
:g body). Default: no completion.
UnknownCommand
Couldn’t resolve the command word to a registered command. No completion possible (we don’t know the schema).
Empty
Empty cmdline. Treated as command-name slot with empty prefix.
Implementations§
Trait Implementations§
Source§impl Clone for CommandLineSlot
impl Clone for CommandLineSlot
Source§fn clone(&self) -> CommandLineSlot
fn clone(&self) -> CommandLineSlot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more