patch 8.2.0385: menu functionality insufficiently tested
Problem: Menu functionality insufficiently tested.
Solution: Add tests. Add menu_info(). (Yegappan Lakshmanan, closes #5760)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 9e8e0fe..5db6718 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -646,6 +646,7 @@
{"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 @@
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