Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Include number of chars in zle unget mechanism in $PENDING calculation



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



Messages sorted by: Reverse Date, Date, Thread, Author