diff src/evalfunc.c @ 19657:da791e5c0139 v8.2.0385

patch 8.2.0385: menu functionality insufficiently tested Commit: https://github.com/vim/vim/commit/0eabd4dc8ff50658f0ea0e92c7918a42242f6b80 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 15 16:13:53 2020 +0100 patch 8.2.0385: menu functionality insufficiently tested Problem: Menu functionality insufficiently tested. Solution: Add tests. Add menu_info(). (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5760)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Mar 2020 16:15:04 +0100
parents 87379c82e9c9
children bc70c52c5c12
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -646,6 +646,7 @@ static funcentry_T global_functions[] =
     {"matchstr",	2, 4, FEARG_1,	  ret_string,	f_matchstr},
     {"matchstrpos",	2, 4, FEARG_1,	  ret_list_any,	f_matchstrpos},
     {"max",		1, 1, FEARG_1,	  ret_any,	f_max},
+    {"menu_info",	1, 2, FEARG_1,	  ret_dict_any,	f_menu_info},
     {"min",		1, 1, FEARG_1,	  ret_any,	f_min},
     {"mkdir",		1, 3, FEARG_1,	  ret_number,	f_mkdir},
     {"mode",		0, 1, FEARG_1,	  ret_string,	f_mode},
@@ -2469,7 +2470,17 @@ f_feedkeys(typval_T *argvars, typval_T *
 	    if (lowlevel)
 	    {
 #ifdef USE_INPUT_BUF
-		add_to_input_buf(keys, (int)STRLEN(keys));
+		int idx;
+		int len = (int)STRLEN(keys);
+
+		for (idx = 0; idx < len; ++idx)
+		{
+		    // if a CTRL-C was typed, set got_int
+		    if (keys[idx] == 3 && ctrl_c_interrupts)
+			got_int = TRUE;
+		    else
+			add_to_input_buf(keys + idx, 1);
+		}
 #else
 		emsg(_("E980: lowlevel input not supported"));
 #endif