Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix 'unset ZLE_RPROMPT_INDENT' not restoring the default behaviour.
- X-seq: zsh-workers 40753
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Fix 'unset ZLE_RPROMPT_INDENT' not restoring the default behaviour.
- Date: Sun, 5 Mar 2017 23:34:02 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=W94Na8S85C0sOYa a5iPxXOk43RA=; b=ZSASiKSdbkr6iEUEcEOk/ExycHHLUWE3Ea/MdQ4x9Bp1PG0 zx6nrvcq+fVhCgqh8Ei7NOhNCjHFWTdyRUN/y+mbmRbFJpVC5k558Jx6xqbnTnEM sOAri3sy9yvYt57IIGgH5eFzEM8mMuzkSqUB3JhmSNBSWPMeP/hzR+c6w+us=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=W94Na8S85C0sOY aa5iPxXOk43RA=; b=Ffv7doPziqunGhit2iNb0Yl//Tn8Dq3RF38eNiBN6QY/Mh rqAqqJnqsqMrR/EPne0tUhIjHPSImsVUWVxKe9/30y+iFKCaZC82fHqF41b4aZwV SEpeEhjPJSUG1MWNDvGUYTiFXr7/lNWarUA7nxoevJzSPjzRwe3RoSCW6WSXw=
- In-reply-to: <1488752733-31896-1-git-send-email-danielsh@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1488752733-31896-1-git-send-email-danielsh@fujitsu.shahaf.local2>
Daniel Shahaf wrote on Sun, Mar 05, 2017 at 22:25:33 +0000:
> +/* Implements gsu_integer.unsetfn for ZLE_RPROMPT_INDENT; see stdunsetfn() */
> +
> +static void
> +rprompt_indent_unsetfn(Param pm, UNUSED(int exp))
> +{
> + rprompt_indent = 1; /* Keep this in sync with init_term() */
> +}
That's wrong: unlike stdunsetfn(), it doesn't add the PM_UNSET bitflag,
so ${+ZLE_RPROMPT_INDENT} remains 1 after unsetting.
Fix:
diff --git a/Src/params.c b/Src/params.c
index f01bbfa..798e92c 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -131,7 +131,7 @@ mod_export int termflags;
/* Forward declaration */
static void
-rprompt_indent_unsetfn(Param pm, UNUSED(int exp));
+rprompt_indent_unsetfn(Param pm, int exp);
/* Standard methods for get/set/unset pointers in parameters */
@@ -3745,8 +3745,9 @@ zlevarsetfn(Param pm, zlong x)
/* Implements gsu_integer.unsetfn for ZLE_RPROMPT_INDENT; see stdunsetfn() */
static void
-rprompt_indent_unsetfn(Param pm, UNUSED(int exp))
+rprompt_indent_unsetfn(Param pm, int exp)
{
+ stdunsetfn(pm, exp);
rprompt_indent = 1; /* Keep this in sync with init_term() */
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author