mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 06:25:13 +02:00
Implement delegate based completion fof the ssh and hyperlinked_grep kittens
This commit is contained in:
@@ -122,3 +122,10 @@ func complete_themes(completions *Completions, word string, arg_num int) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func completion_for_wrapper(wrapped_cmd string) func(*Command, []string, *Completions) {
|
||||
return func(cmd *Command, args []string, completions *Completions) {
|
||||
completions.Delegate.NumToRemove = completions.current_word_idx + 1
|
||||
completions.Delegate.Command = wrapped_cmd
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +183,10 @@ func default_parse_args(cmd *Command, words []string, completions *Completions)
|
||||
arg_num = 0
|
||||
completions.current_word_idx_in_parent = 0
|
||||
only_args_allowed = false
|
||||
if cmd.Parse_args != nil {
|
||||
cmd.Parse_args(cmd, words[i+1:], completions)
|
||||
return
|
||||
}
|
||||
} else if cmd.Stop_processing_at_arg > 0 && arg_num >= cmd.Stop_processing_at_arg {
|
||||
return
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user