From: Eric Freese <ericdfreese@gmail.com>
To: zsh-workers@zsh.org
Cc: Eric Freese <ericdfreese@gmail.com>
Subject: [PATCH] Include number of chars in zle unget mechanism in $PENDING calculation
Date: Tue, 28 Feb 2017 18:25:34 -0700 [thread overview]
Message-ID: <20170301012534.67145-1-ericdfreese@gmail.com> (raw)
Tested locally with the following:
% self-insert() { echo "$PENDING" >> log; zle .self-insert -- $@ }
% zle -N self-insert
% foo() { zle -U "hello"; zle -U "world" }
% zle -N foo
% bindkey ^B foo
After pressing C-b, the buffer reads:
worldhello
And the contents of log are:
9
8
7
6
5
4
3
2
1
0
---
Src/Zle/zle_params.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index 1e4c5b8..476e9a7 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -512,7 +512,7 @@ get_bufferlines(UNUSED(Param pm))
static zlong
get_pending(UNUSED(Param pm))
{
- return noquery(0);
+ return kungetct + noquery(0);
}
/**/
--
2.9.0
next reply other threads:[~2017-03-01 1:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-01 1:25 Eric Freese [this message]
2017-03-01 2:52 ` Bart Schaefer
2017-03-01 3:51 ` Eric Freese
2017-03-02 14:31 ` Peter Stephenson
2017-03-01 14:41 ` Eric Freese
2017-03-03 23:54 Eric Freese
2017-03-04 14:53 ` 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=20170301012534.67145-1-ericdfreese@gmail.com \
--to=ericdfreese@gmail.com \
--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).