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

Re: [BUG] zle_highlight fails to highlight suffix added with compadd -R

On 9/8/21, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Tue, Sep 7, 2021 at 3:07 AM Marlon Richert <marlon.richert@xxxxxxxxx>
> wrote:
>> _tst() { compadd -S '<SUFFIX>' -q -- '' }
>> _tst() { compadd -S '<SUFFIX>' -r '' -- '' }
>> _tst() { compadd -S '<SUFFIX>' -R '' -- '' }
>> With the first two functions, <SUFFIX> correctly gets highlighted as
>> autoremovable. However, with the third function, <SUFFIX> does not get
>> highlighted, even though it is autoremovable.
> -R is supposed to be followed by the name of a function.  You gave it
> the empty string.  That should probably have been an error right off
> the bat, but it does mean the suffix can't possibly be autoremoved.
> However, the same highlight behavior occurs even if you do supply a
> working subroutine.  Does anyone remember why suffixfunclen needed to
> be stored separately?

I didn't make any attempt to understand the code, but can you usefully
specify both -r and -R? (it doesn't appear to be an error).

Mikael Magnusson

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