To: vim_dev@googlegroups.com Subject: Patch 8.2.0946 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0946 Problem: Cannot use "q" to cancel a number prompt. Solution: Recognize "q" instead of ignoring it. Files: src/misc1.c, src/testdir/test_functions.vim *** ../vim-8.2.0945/src/misc1.c 2020-05-10 14:13:58.859609394 +0200 --- src/misc1.c 2020-06-10 15:38:12.466400710 +0200 *************** *** 945,951 **** do_redraw = FALSE; break; } ! else if (c == CAR || c == NL || c == Ctrl_C || c == ESC) break; } --no_mapping; --- 945,951 ---- do_redraw = FALSE; break; } ! else if (c == CAR || c == NL || c == Ctrl_C || c == ESC || c == 'q') break; } --no_mapping; *************** *** 967,975 **** // When using ":silent" assume that was entered. if (mouse_used != NULL) ! msg_puts(_("Type number and or click with mouse (empty cancels): ")); else ! msg_puts(_("Type number and (empty cancels): ")); // Set the state such that text can be selected/copied/pasted and we still // get mouse events. redraw_after_callback() will not redraw if cmdline_row --- 967,975 ---- // When using ":silent" assume that was entered. if (mouse_used != NULL) ! msg_puts(_("Type number and or click with the mouse (q or empty cancels): ")); else ! msg_puts(_("Type number and (q or empty cancels): ")); // Set the state such that text can be selected/copied/pasted and we still // get mouse events. redraw_after_callback() will not redraw if cmdline_row *** ../vim-8.2.0945/src/testdir/test_functions.vim 2020-06-02 22:19:45.310490731 +0200 --- src/testdir/test_functions.vim 2020-06-10 15:41:16.697780183 +0200 *************** *** 1371,1376 **** --- 1371,1388 ---- call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\3\", 'tx') call assert_equal(3, c) + " CR to cancel + call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\\", 'tx') + call assert_equal(0, c) + + " Esc to cancel + call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\\", 'tx') + call assert_equal(0, c) + + " q to cancel + call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\q", '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'])\1\3\2\", 'tx') call assert_equal(2, c) *** ../vim-8.2.0945/src/version.c 2020-06-10 15:32:04.455653633 +0200 --- src/version.c 2020-06-10 15:45:23.312953579 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 946, /**/ -- Q: How does a UNIX Guru do Sex ? A: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///