On Fri, May 7, 2021 at 7:09 AM Marlon Richert wrote: > > This bug is similar to the one I reported in workers/47858. Only superficially. > This works correctly: > > % setopt completeinword > % tst() { print "\n$compstate[context]"; zle -I } I think there's something missing here for the test case. A style or a bindkey? Something to run "tst"? > % # place cursor after '${(' and press Tab: > % : ${()foo} This is actually a failure in the interpretation of the cursor position within the C code. An existing comment says: * We are still within the parameter flags. There's no * point trying to do anything clever here with * parameter names. Instead, just report that we are in * a brace parameter but let the completion function * decide what to do about it. The issue was that "still within the flags" assumed complete_in_word was not set. An earlier test had a similar mistake when the closing brace of the entire parameter expression was already present. Patch below attempts to fix those assumptions, but still leaves further effort up to the completion function ... which currently completes nothing when the parens are empty. I'm leaving that for someone else to work on. I also expanded on an existing comment.