From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] _describe and literal \n
Date: Sat, 23 Jul 2016 21:23:45 +0000 [thread overview]
Message-ID: <20160723212345.GA2982@tarsus.local2> (raw)
In-Reply-To: <160723130059.ZM19333@torch.brasslantern.com>
Bart Schaefer wrote on Sat, Jul 23, 2016 at 13:00:59 -0700:
> On Jul 23, 6:04pm, Daniel Shahaf wrote:
> }
> } Gives:
> } [[[
> } % f <TAB>
> } bar -- lorem\nipsum
> } foo -- hello\nworld
> } ]]]
> }
> } Is this fix correct?
>
> Boy, that's a tough one. If the embedded newlines mess up something else,
> like for example menuselect keeping track of lines/columns/cursor, then
> I'd say this is the closest thing to a correct quick-fix.
>
> On the other hand if the extra newlines are handled correctly, then I'd
> say this fix isn't warranted, and it's up to the caller to decide what
> is meant when a newline appears in the descriptions.
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
With the patch:
% f <TAB>
baz bar -- lorem\nipsum
foo -- hello\nworld
Never mind the fact that current, unpatched, master escaped the newline
this time; the more important difference is that current master arranges
the display as though the description of foo is "lorem ipsum" and of bar
is "hello world", which is incorrect.
Cheers,
Daniel
next prev parent reply other threads:[~2016-07-23 21:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-23 18:04 Daniel Shahaf
2016-07-23 20:00 ` Bart Schaefer
2016-07-23 21:23 ` Daniel Shahaf [this message]
2016-07-23 23:27 ` Oliver Kiddle
2016-07-24 1:27 ` Bart Schaefer
2016-07-24 21:30 ` Daniel Shahaf
2016-09-27 20:32 ` Oliver Kiddle
2016-09-29 14:11 ` Daniel Shahaf
2016-09-29 14:28 ` Daniel Shahaf
2016-10-07 13:50 ` Daniel Shahaf
2016-10-07 14:53 ` Bart Schaefer
2016-10-08 7:42 ` Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160723212345.GA2982@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).