diff options
author | Bram Moolenaar <Bram@vim.org> | 2011-10-12 22:02:14 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2011-10-12 22:02:14 +0200 |
commit | b3479bd2297d9a8d9614bb7c906e4a24b8d162bd (patch) | |
tree | 4c370ea5de6a500ad50100a3b162d96a55ab17c6 /src/getchar.c | |
parent | 2e7b1df8fade5d87c7e12e2439710c0ea8137c81 (diff) |
updated for version 7.3.338v7.3.338
Problem: Using getchar() in an expression mapping doesn't work well.
Solution: Don't save and restore the typeahead. (James Vega)
Diffstat (limited to 'src/getchar.c')
-rw-r--r-- | src/getchar.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/getchar.c b/src/getchar.c index 16bf65a0b9..a895483a4a 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -2460,27 +2460,18 @@ vgetorpeek(advance) /* * Handle ":map <expr>": evaluate the {rhs} as an - * expression. Save and restore the typeahead so that - * getchar() can be used. Also save and restore the - * command line for "normal :". + * expression. Also save and restore the command line + * for "normal :". */ if (mp->m_expr) { - tasave_T tabuf; int save_vgetc_busy = vgetc_busy; - save_typeahead(&tabuf); - if (tabuf.typebuf_valid) - { - vgetc_busy = 0; - save_m_keys = vim_strsave(mp->m_keys); - save_m_str = vim_strsave(mp->m_str); - s = eval_map_expr(save_m_str, NUL); - vgetc_busy = save_vgetc_busy; - } - else - s = NULL; - restore_typeahead(&tabuf); + vgetc_busy = 0; + save_m_keys = vim_strsave(mp->m_keys); + save_m_str = vim_strsave(mp->m_str); + s = eval_map_expr(save_m_str, NUL); + vgetc_busy = save_vgetc_busy; } else #endif |