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

Re: [PATCH] _describe and literal \n



Daniel Shahaf wrote:
> I haven't been able to get menu selection's highlighting to misbehave.
>
> However, consider this:
>
> Current master:
>     % _f() { a=( $'foo:hello\nworld' $'bar:lorem\nipsum' $'baz:lorem\nipsum' ); _describe descr a }
>     % f <TAB>
>     baz  
>     foo  -- lorem\nipsum
>     bar  -- hello\nworld

Is your fix to the internals of _describe or the more general code.
Note that _describe truncates descriptions but by using compadd -ld, you
can have multiline descriptions and it works well. fc completion often
contains newlines and I've never had issues with it. However, I think
the intention in _describe was to not have newlines.

I'm not especially fond of the \n escapes. Would prefer they were mapped
to spaces. However, failing to group baz and foo is clearly wrong.

It could be worth experimenting with long strings that approach the
right edge of the terminal to see if it is affecting the calculations.

Oliver



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