Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from nm26-vm3.bullet.mail.ir2.yahoo.com by f.primenet.com.au (envelope-from <okiddle@yahoo.co.uk>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(212.82.97.45):SA:0(0.0/5.0):. 
 Processed in 0.121356 secs); 23 Jul 2016 23:34:12 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS,
	T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1
X-Envelope-From: okiddle@yahoo.co.uk
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.mail.yahoo.com designates 212.82.97.45 as permitted sender)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1469316429; bh=g63ND32hTe8O90DPJkABnBu5zTwbsFBciWppv1fe3Zk=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=rQxFSNU0IJOhO7CJFRZhZZElaJ+q3Iac/hcWpEXbs4P+J2z9SRg5DDrjRS7LJv3RdOyR28D8w5JE1MlJ1yUoHntM0v/gZqDPh0oqW4KCuhyA0+bcKidinSq7+qDPUi0UM8sZqLvyqESLFE4HMlV+D9ygh6fvvsUE37s+k82jn+KRr0GiFg/h3uxiO3yuoIMfUF52iUF1AoORjpmIBZSeISPZD8LiYPq5j9RE9MPNew6j1GhEzUQCjhikhBWMDWJdQcSWTCEYOwSGs0HNba5wCKyktKAFfp2iB2rnQ/iuYXavbfpErb9amnZ8mbnPg4vnhYeZNKLfjrzLF/j/A1UguQ==
X-Yahoo-Newman-Id: 516548.28557.bm@smtp112.mail.ir2.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: yT8AfGgVM1kCqNhOMuyPfj4vdQVw.hB8z1kfg0iMCWK.ecY
 pLpy8kWVvbcDIGIei6Bf2apdg9wuWu.PzBZ_WIm_zLBl3cBpiOsox5u4tkqF
 zrHmBrP6vMdM2hijA4N5qQ.uRv0JupgRrM2A3N3VMivlbhZPlMQvdixnV8vr
 LR7ZQeyyxtHup7R7qbCHXrD8vzQ7.iT54e_wni9KwJYeOO8UpPVUWic7taX3
 _G92.n7WaArN0RccI0zEnOmxTnX4waKMOeY4n4Oo0cir9Q5YUyBmMW9vHZ_d
 JjNB5gWcdvsqLWJ6zh0DaPO6WZlKQ0tS.SMkoy5AZZkqp6LvAkJ.vD_GV7z3
 oQFUvr33KoXiY13HW4ddG1LbEEVRiIE_SJ0uHt4HtV84.ZO8fV55WomSOJGV
 EXb9d.KnhcbwAK0ikATLBGDd5Th7nS6I1cdsbtLWZ3gfoWD3WaavNVc_IzV6
 sT6VXf4P0w8.7HRs_Y2vzQAfcUhi3adshHx4FAqarv2H2flOFEmzESeN2B.V
 WRhlvmxxxJXgQrYL9k2SMrOAfsc9TXzntqE4w.3Ny57w-
X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI-
In-reply-to: <20160723212345.GA2982@tarsus.local2>
From: Oliver Kiddle <okiddle@yahoo.co.uk>
References: <20160723180430.GA22451@tarsus.local2> <160723130059.ZM19333@torch.brasslantern.com> <20160723212345.GA2982@tarsus.local2>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] _describe and literal \n
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <5529.1469316428.1@hydra.kiddle.eu>
Date: Sun, 24 Jul 2016 01:27:08 +0200
Message-ID: <5530.1469316428@hydra.kiddle.eu>
X-Seq: zsh-workers 38930

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

