From 533d839384492fcdf851a94f597c989491d9b361 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 3 Nov 2016 17:03:37 +0000 Subject: unposted: comment explaining key buffer handling. Describe putting back the tail end of the key buffer into the input. --- ChangeLog | 5 +++++ Src/Zle/zle_keymap.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index ed07399a6..cc78b8595 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-11-03 Peter Stephenson + + * unposted: Src/Zle/zle_keymap.c: comment explaining putting + back tail end of key buffer into input. + 2016-11-03 Daniel Shahaf * 39806: Src/Zle/zle_vi.c: internal: Document zle's vichgbuf. diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index 34c9c686e..053b097bb 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -1621,6 +1621,13 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp) else lastchar = lastc; if(lastlen != keybuflen) { + /* + * We want to keep only the first lastlen bytes of the key + * buffer in the key buffer that were marked as used by the key + * binding above, and make the rest available for input again. + * That rest (but not what we are keeping) needs to be + * unmetafied. + */ unmetafy(keybuf + lastlen, &keybuflen); ungetbytes(keybuf+lastlen, keybuflen); if(vichgflag) -- cgit 1.4.1