Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[BUG] REPORTTIME parsed as 0 with error in zle widget
- X-seq: zsh-workers 42358
- From: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: [BUG] REPORTTIME parsed as 0 with error in zle widget
- Date: Mon, 12 Feb 2018 10:05:08 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= content-type:content-type:mime-version:user-agent:date:date :message-id:subject:subject:from:from:received:received; s= postfix2; t=1518426316; bh=1I0lMjesjAIHl8C1CyN7YMziP7M4zgNBEwkbX aqSeXk=; b=WIUbCAlsiqUtWuQ7wUuJ7FA0nAt/Ij3oqw+8Xgr51ClydNSedmaxW vhhIv2xbUUI3DYsnniAdnUcH48wGqcL2VozvC7iyLMh8/TwfnHNC8orntYK6pLg+ WqTkoECepCvvioJVVqldqbMkx0m1eUNa5q8gH7zKjx1jx1UY98UEV8=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Given the following zle widget:
__fsel() {
exit 130 | while read item; do
:
done
}
mywidget() {
LBUFFER="${LBUFFER}$(__fsel)"
}
zle -N mywidget
bindkey '^r' mywidget
TEST CASE:
1. source it
2. set REPORTTIME=5
3. run it (ctrl-r)
RESULT:
time gets reported, but should not
getintvalue in should_report_time returns 0, although getstrvalue(v) is "5"!
This is caused by errflag being set in matheval, which makes it return 0!
And this gets caused by "exit 130" in __fsel.
I've noticed this with fzf and its widgets, where 130 is returned when selecting nothing.
btw: for fzf it makes sense to unset REPORTTIME like it has been done recently for completion functions already.
Cheers,
Daniel.
Attachment:
signature.asc
Description: OpenPGP digital signature
Messages sorted by:
Reverse Date,
Date,
Thread,
Author