Skip to main content

current_slot

Function current_slot 

Source
pub fn current_slot(
    line: &str,
    cursor: usize,
    registry: &CommandRegistry,
    alias_resolve: &dyn Fn(&str) -> Option<String>,
) -> CommandLineSlot
Expand description

Detect what slot the cursor is on. line is the text on the command line (without the leading :); cursor is a byte offset within line (0..=line.len()).

alias_resolve is a callback the host supplies to translate short forms (w -> ex:write) before looking up the command in the registry. Living in the host means lattice-completion doesn’t bake in TUI-specific aliases.