0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

patch 8.2.0258: modifyOtherKeys cannot be temporarily disabled

Problem:    ModifyOtherKeys cannot be temporarily disabled.
Solution:   Add echoraw() with an example for modifyOtherKeys.
This commit is contained in:
Bram Moolenaar
2020-02-14 16:53:00 +01:00
parent 00f3b4e007
commit 4132eb505c
5 changed files with 56 additions and 1 deletions

View File

@@ -60,6 +60,7 @@ static void f_debugbreak(typval_T *argvars, typval_T *rettv);
#endif
static void f_deepcopy(typval_T *argvars, typval_T *rettv);
static void f_did_filetype(typval_T *argvars, typval_T *rettv);
static void f_echoraw(typval_T *argvars, typval_T *rettv);
static void f_empty(typval_T *argvars, typval_T *rettv);
static void f_environ(typval_T *argvars, typval_T *rettv);
static void f_escape(typval_T *argvars, typval_T *rettv);
@@ -394,6 +395,7 @@ static funcentry_T global_functions[] =
{"did_filetype", 0, 0, 0, &t_number, f_did_filetype},
{"diff_filler", 1, 1, FEARG_1, &t_number, f_diff_filler},
{"diff_hlID", 2, 2, FEARG_1, &t_number, f_diff_hlID},
{"echoraw", 1, 1, FEARG_1, &t_number, f_echoraw},
{"empty", 1, 1, FEARG_1, &t_number, f_empty},
{"environ", 0, 0, 0, &t_dict_string, f_environ},
{"escape", 2, 2, FEARG_1, &t_string, f_escape},
@@ -1813,6 +1815,21 @@ f_did_filetype(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
rettv->vval.v_number = did_filetype;
}
/*
* "echoraw({expr})" function
*/
static void
f_echoraw(typval_T *argvars, typval_T *rettv UNUSED)
{
char_u *str = tv_get_string_chk(&argvars[0]);
if (str != NULL && *str != NUL)
{
out_str(str);
out_flush();
}
}
/*
* "empty({expr})" function
*/