Patch 8.2.4427
Problem: getchar() may return modifiers if no character is available.
Solution: Do not process modifiers when there is no character. (closes #9806)
Files: src/getchar.c, src/testdir/test_functions.vim
*** ../vim-8.2.4426/src/getchar.c 2022-02-16 19:24:03.622162411 +0000
--- src/getchar.c 2022-02-20 19:00:15.516490256 +0000
***************
*** 2103,2109 ****
set_vim_var_nr(VV_MOUSE_COL, 0);
rettv->vval.v_number = n;
! if (IS_SPECIAL(n) || mod_mask != 0)
{
char_u temp[10]; // modifier: 3, mbyte-char: 6, NUL: 1
int i = 0;
--- 2103,2109 ----
set_vim_var_nr(VV_MOUSE_COL, 0);
rettv->vval.v_number = n;
! if (n != 0 && (IS_SPECIAL(n) || mod_mask != 0))
{
char_u temp[10]; // modifier: 3, mbyte-char: 6, NUL: 1
int i = 0;
*** ../vim-8.2.4426/src/testdir/test_functions.vim 2022-02-12
20:34:47.084825186 +0000
--- src/testdir/test_functions.vim 2022-02-20 18:59:21.776591442 +0000
***************
*** 1818,1823 ****
--- 1818,1827 ----
call assert_equal('', getcharstr(0))
call assert_equal('', getcharstr(1))
+ call feedkeys("\<M-F2>", '')
+ call assert_equal("\<M-F2>", getchar(0))
+ call assert_equal(0, getchar(0))
+
call setline(1, 'xxxx')
call test_setmouse(1, 3)
let v:mouse_win = 9
*** ../vim-8.2.4426/src/version.c 2022-02-20 18:26:43.111537896 +0000
--- src/version.c 2022-02-20 19:01:58.316299075 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4427,
/**/
--
Ed's Radiator Shop: The Best Place in Town to Take a Leak.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220220190550.441561C0FE0%40moolenaar.net.