From 5f076d1390bba5a4da13b79e6513839dd848fc9b Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sat, 24 Sep 2005 18:49:42 +0000 Subject: 21760: fix test for sequence prefixes in the local keymap in getkeymapcmd() --- Src/Zle/zle_keymap.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Src/Zle/zle_keymap.c') diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c index 376805549..de1d918ba 100644 --- a/Src/Zle/zle_keymap.c +++ b/Src/Zle/zle_keymap.c @@ -1293,19 +1293,25 @@ getkeymapcmd(Keymap km, Thingy *funcp, char **strp) while(getkeybuf(!!lastlen) != EOF) { char *s; Thingy f; - int loc = 1; + int loc = !!localkeymap; + int ispfx = 0; - if (!localkeymap || - (f = keybind(localkeymap, keybuf, &s)) == t_undefinedkey) - loc = 0, f = keybind(km, keybuf, &s); + if (loc) { + loc = ((f = keybind(localkeymap, keybuf, &s)) != t_undefinedkey); + ispfx = keyisprefix(localkeymap, keybuf); + } + if (!loc && !ispfx) { + f = keybind(km, keybuf, &s); + ispfx = keyisprefix(km, keybuf); + } - if(f != t_undefinedkey) { + if (f != t_undefinedkey) { lastlen = keybuflen; func = f; str = s; lastc = lastchar; } - if(!keyisprefix((loc ? localkeymap : km), keybuf)) + if (!ispfx) break; } if(!lastlen && keybuflen) -- cgit 1.4.1