diff src/misc1.c @ 20788:072ad890c227 v8.2.0946

patch 8.2.0946: cannot use "q" to cancel a number prompt Commit: https://github.com/vim/vim/commit/eebd555733491cb55b9f30fe28772c0fd0ebacf7 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 10 15:45:57 2020 +0200 patch 8.2.0946: cannot use "q" to cancel a number prompt Problem: Cannot use "q" to cancel a number prompt. Solution: Recognize "q" instead of ignoring it.
author Bram Moolenaar <Bram@vim.org>
date Wed, 10 Jun 2020 16:00:05 +0200
parents d636f5e76347
children 9064044fd4f6
line wrap: on
line diff
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -945,7 +945,7 @@ get_number(
 	    do_redraw = FALSE;
 	    break;
 	}
-	else if (c == CAR || c == NL || c == Ctrl_C || c == ESC)
+	else if (c == CAR || c == NL || c == Ctrl_C || c == ESC || c == 'q')
 	    break;
     }
     --no_mapping;
@@ -967,9 +967,9 @@ prompt_for_number(int *mouse_used)
 
     // When using ":silent" assume that <CR> was entered.
     if (mouse_used != NULL)
-	msg_puts(_("Type number and <Enter> or click with mouse (empty cancels): "));
+	msg_puts(_("Type number and <Enter> or click with the mouse (q or empty cancels): "));
     else
-	msg_puts(_("Type number and <Enter> (empty cancels): "));
+	msg_puts(_("Type number and <Enter> (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