Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Include number of chars in zle unget mechanism in $PENDING calculation
- X-seq: zsh-workers 40716
- From: Eric Freese <ericdfreese@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Include number of chars in zle unget mechanism in $PENDING calculation
- Date: Fri, 3 Mar 2017 16:54:39 -0700
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=yxcE2gPWK7YbpsvlVlSLVGboEaXqAajshU03H6mmA3E=; b=UWl+xH0QbqyX9Mhcspw0SIZH6BPNdTTMvcgYOVBTF0V3ZvwMyyIBvEHx6ccNnM+jfy 5TnexlCHTONOaVB0dagWmLhOsp5ijRLSSor00MiANZpPTwO6MKFWMNs/QSvtAR6QE5+8 B0rELryKbVdv6pK2xKwF59VrQLV7/9jyyFjOe5tiakPjN29u90+aMhAVHLSd7gsfHxEi wI2Oiy6LJJ7QdLoHoTjo798RGjQ/xWeIthPpjYr7gPT/VjvPRhRSoEyuIB55+ZrHGQY8 +mJkUYHAKh1fMTr6iQvpOAX84jBq/DcliPJcKvz8FxC6d/clfeoOsGoUS3mB3mD8MN1g okMQ==
- 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
This looks great! Pulled it down and it solves my problem.
Would love to see this merged.
> How about...
>
> pws
>
> diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
> index d68365b..b65e3be 100644
> --- a/Doc/Zsh/zle.yo
> +++ b/Doc/Zsh/zle.yo
> @@ -864,6 +864,12 @@ vindex(KEYS)
> item(tt(KEYS) (scalar))(
> The keys typed to invoke this widget, as a literal string; read-only.
> )
> +vindex(KEYS_QUEUED_COUNT)
> +item(tt(KEYS_QUEUED_COUNT) (integer))(
> +The number of bytes pushed back to the input queue and therefore
> +available for reading immediately before any I/O is done; read-only.
> +See also tt(PENDING); the two values are distinct.
> +)
> vindex(killring)
> item(tt(killring) (array))(
> The array of previously killed items, with the most recently killed
first.
> @@ -919,7 +925,8 @@ item(tt(PENDING) (integer))(
> The number of bytes pending for input, i.e. the number of bytes which
have
> already been typed and can immediately be read. On systems where the
shell
> is not able to get this information, this parameter will always have a
> -value of zero. Read-only.
> +value of zero. Read-only. See also tt(KEYS_QUEUED_COUNT); the two
> +values are distinct.
> )
> vindex(PREBUFFER)
> item(tt(PREBUFFER) (scalar))(
> diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
> index 1e4c5b8..0a922d2 100644
> --- a/Src/Zle/zle_params.c
> +++ b/Src/Zle/zle_params.c
> @@ -85,6 +85,8 @@ static const struct gsu_integer cursor_gsu =
> { get_cursor, set_cursor, zleunsetfn };
> static const struct gsu_integer histno_gsu =
> { get_histno, set_histno, zleunsetfn };
> +static const struct gsu_integer keys_queued_count_gsu =
> +{ get_keys_queued_count, NULL, zleunsetfn };
> static const struct gsu_integer mark_gsu =
> { get_mark, set_mark, zleunsetfn };
> static const struct gsu_integer numeric_gsu =
> @@ -146,6 +148,8 @@ static struct zleparam {
> { "HISTNO", PM_INTEGER, GSU(histno_gsu), NULL },
> { "KEYMAP", PM_SCALAR | PM_READONLY, GSU(keymap_gsu), NULL },
> { "KEYS", PM_SCALAR | PM_READONLY, GSU(keys_gsu), NULL },
> + { "KEYS_QUEUED_COUNT", PM_INTEGER | PM_READONLY,
GSU(keys_queued_count_gsu),
> + NULL},
> { "killring", PM_ARRAY, GSU(killring_gsu), NULL },
> { "LASTABORTEDSEARCH", PM_SCALAR | PM_READONLY,
GSU(lastabortedsearch_gsu),
> NULL },
> @@ -458,6 +462,13 @@ get_keys(UNUSED(Param pm))
> }
>
> /**/
> +static zlong
> +get_keys_queued_count(UNUSED(Param pm))
> +{
> + return kungetct;
> +}
> +
> +/**/
> static void
> set_numeric(UNUSED(Param pm), zlong x)
> {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author