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

[BUG] COMPLETE_IN_WORD fails to recognize brace_parameter context



This bug is similar to the one I reported in workers/47858.

This works correctly:

% setopt completeinword
% tst() { print "\n$compstate[context]"; zle -I }
% # place cursor after '${(' and press Tab:
% : ${(foo
brace_parameter
% foo=( ${(
brace_parameter
% foo=${(
brace_parameter
% [[ ${(foo ]]
brace_parameter

But if you've already typed more and you want to add parameter flags
later on, $compstate[context] is no longer accurate:

% # place cursor after '${(' and press Tab:
% : ${()foo}
command
% foo=( ${( )
array_value
% foo=${()bar}
value
% [[ ${()foo} ]]
condition

This matters when using the _prefix completer. I would expect to get
parameter flag completions for the cases above. But because
$compstate[context] does not equal 'brace_parameter', _complete will
never call _brace_parameter.




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