comparison src/getchar.c @ 27802:9b01fea87065 v8.2.4427

patch 8.2.4427: getchar() may return modifiers if no character is available Commit: https://github.com/vim/vim/commit/ad6c45f62558e03d3e3a927b3fe4dbaf30a36bef Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Feb 20 19:05:10 2022 +0000 patch 8.2.4427: getchar() may return modifiers if no character is available Problem: getchar() may return modifiers if no character is available. Solution: Do not process modifiers when there is no character. (closes https://github.com/vim/vim/issues/9806)
author Bram Moolenaar <Bram@vim.org>
date Sun, 20 Feb 2022 20:15:03 +0100
parents c1d1639b52dd
children 5147f3d3ed30
comparison
equal deleted inserted replaced
27801:db4fb9a86f79 27802:9b01fea87065
2101 set_vim_var_nr(VV_MOUSE_WINID, 0); 2101 set_vim_var_nr(VV_MOUSE_WINID, 0);
2102 set_vim_var_nr(VV_MOUSE_LNUM, 0); 2102 set_vim_var_nr(VV_MOUSE_LNUM, 0);
2103 set_vim_var_nr(VV_MOUSE_COL, 0); 2103 set_vim_var_nr(VV_MOUSE_COL, 0);
2104 2104
2105 rettv->vval.v_number = n; 2105 rettv->vval.v_number = n;
2106 if (IS_SPECIAL(n) || mod_mask != 0) 2106 if (n != 0 && (IS_SPECIAL(n) || mod_mask != 0))
2107 { 2107 {
2108 char_u temp[10]; // modifier: 3, mbyte-char: 6, NUL: 1 2108 char_u temp[10]; // modifier: 3, mbyte-char: 6, NUL: 1
2109 int i = 0; 2109 int i = 0;
2110 2110
2111 // Turn a special key into three bytes, plus modifier. 2111 // Turn a special key into three bytes, plus modifier.