Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

compadd not returning completion options



I have a custom completion script I'm working on that has a few different functions used for completion (I'm modifying existing completion scripts so I can't change some of them)

__start_k -> calls __k_handle_word -> calls __k_handle_kspace -> calls __k_kspace_parse_config

The __k_kspace_parse_config is where I run compadd for my completions

I can see it being run if I set -x in that function (I'm echoing the array at the end of the compadd command and also tried with -a array_name)

+__k_kspace_parse_config:33> compadd -X CONTEXTS -P + -S '' bottlerocket dev.demo.jgarr.net rothgar@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx rothgar@xxxxxxxxxxxxxxxxxxxxxxxxxxx rothgar@xxxxxxxxxxxxxxxxxxxxxxxx rothgar@xxxxxxxx-west-2

$: k +
 -- no matches found --

but this returns no matches even though the k_out array has values.

If I run 

compdef __k_handle_kspace k

everything works as expected. I'm not sure why it matters which function I use when the function that sets the completion values is still the same.

I have some more links to the code and information here in stackoverflow but haven't been able to figure out why this is happening.
https://stackoverflow.com/questions/64150319/compadd-doesnt-work-when-called-from-nested-functions

Any pointers or help on what I could be doing wrong are appreciated.


--
Justin Garrison
justingarrison.com


Messages sorted by: Reverse Date, Date, Thread, Author