zsh-workers
 help / color / mirror / code / Atom feed
* compadd not returning completion options
@ 2020-10-01 23:53 Justin Garrison
  2020-10-02 16:26 ` Oliver Kiddle
  0 siblings, 1 reply; 3+ messages in thread
From: Justin Garrison @ 2020-10-01 23:53 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1347 bytes --]

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@alb-v2-ec2.us-west-2.eksctl.io
rothgar@fargate.us-west-2.eksctl.io rothgar@prod.us-west-2.eksctl.io
rothgar@stage.us-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

[-- Attachment #2: Type: text/html, Size: 3489 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-03  8:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-01 23:53 compadd not returning completion options Justin Garrison
2020-10-02 16:26 ` Oliver Kiddle
2020-10-03  8:15   ` Justin Garrison

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).