Patch 8.2.2875
Problem: Cancelling inputlist() after a digit does not return zero.
Solution: Always return zero when cancelling. (closes #8231)
Files: src/misc1.c, src/testdir/test_functions.vim
*** ../vim-8.2.2874/src/misc1.c 2021-02-15 20:37:58.457374538 +0100
--- src/misc1.c 2021-05-20 21:08:55.904522855 +0200
***************
*** 946,952 ****
do_redraw = FALSE;
break;
}
! else if (c == CAR || c == NL || c == Ctrl_C || c == ESC || c == 'q')
break;
}
--no_mapping;
--- 946,957 ----
do_redraw = FALSE;
break;
}
! else if (c == Ctrl_C || c == ESC || c == 'q')
! {
! n = 0;
! break;
! }
! else if (c == CAR || c == NL )
break;
}
--no_mapping;
*** ../vim-8.2.2874/src/testdir/test_functions.vim 2021-05-19
17:15:00.825866111 +0200
--- src/testdir/test_functions.vim 2021-05-20 21:08:55.904522855 +0200
***************
*** 1480,1485 ****
--- 1480,1489 ----
call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green',
'3. blue'])\<cr>q", 'tx')
call assert_equal(0, c)
+ " Cancel after inputting a number
+ call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green',
'3. blue'])\<cr>5q", 'tx')
+ call assert_equal(0, c)
+
" Use backspace to delete characters in the prompt
call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green',
'3. blue'])\<cr>1\<BS>3\<BS>2\<cr>", 'tx')
call assert_equal(2, c)
*** ../vim-8.2.2874/src/version.c 2021-05-20 11:54:07.229060243 +0200
--- src/version.c 2021-05-20 21:11:12.411869452 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2875,
/**/
--
'I generally avoid temptation unless I can't resist it."
-- Mae West
/// 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/202105201914.14KJErj3412018%40masaka.moolenaar.net.