diff options
author | mityu <mityu.mail@gmail.com> | 2021-07-19 20:07:21 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-19 20:07:21 +0200 |
commit | 6106504e9edc8500131f7a36e59bc146f90180fa (patch) | |
tree | 69249dd7c9375375cb414ea31e3b5523e8947344 /src/evalfunc.c | |
parent | 98c2eaed27579602e05e7b96aa3a60428a8b9cb2 (diff) |
patch 8.2.3184: cannot add a digraph with a leading spacev8.2.3184
Problem: Cannot add a digraph with a leading space. It is not easy to list
existing digraphs.
Solution: Add setdigraph(), setdigraphlist(), getdigraph() and
getdigraphlist(). (closes #8580)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 2964d23912..1a7f427815 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -493,6 +493,7 @@ static argcheck_T arg1_chan_or_job[] = {arg_chan_or_job}; static argcheck_T arg2_float_or_nr[] = {arg_float_or_nr, arg_float_or_nr}; static argcheck_T arg2_number[] = {arg_number, arg_number}; static argcheck_T arg2_string[] = {arg_string, arg_string}; +static argcheck_T arg2_string_number[] = {arg_string, arg_number}; static argcheck_T arg2_list_nr[] = {arg_list_number, arg_list_number}; static argcheck_T arg2_nr_string[] = {arg_number, arg_string}; static argcheck_T arg2_dict_string[] = {arg_dict_any, arg_string}; @@ -585,6 +586,12 @@ ret_list_items(int argcount UNUSED, type_T **argtypes UNUSED) { return &t_list_list_any; } + + static type_T * +ret_list_string_items(int argcount UNUSED, type_T **argtypes UNUSED) +{ + return &t_list_list_string; +} static type_T * ret_dict_any(int argcount UNUSED, type_T **argtypes UNUSED) { @@ -1107,6 +1114,10 @@ static funcentry_T global_functions[] = ret_list_number, f_getcursorcharpos}, {"getcwd", 0, 2, FEARG_1, arg2_number, ret_string, f_getcwd}, + {"getdigraph", 1, 1, FEARG_1, arg1_string, + ret_string, f_getdigraph}, + {"getdigraphlist", 0, 1, FEARG_1, arg1_number, + ret_list_string_items, f_getdigraphlist}, {"getenv", 1, 1, FEARG_1, arg1_string, ret_any, f_getenv}, {"getfontname", 0, 1, 0, arg1_string, @@ -1567,6 +1578,10 @@ static funcentry_T global_functions[] = ret_number_bool, f_setcmdpos}, {"setcursorcharpos", 1, 3, FEARG_1, NULL, ret_number_bool, f_setcursorcharpos}, + {"setdigraph", 2, 2, FEARG_1, arg2_string_number, + ret_bool, f_setdigraph}, + {"setdigraphlist", 1, 1, FEARG_1, arg1_list_string, + ret_bool, f_setdigraphlist}, {"setenv", 2, 2, FEARG_2, NULL, ret_void, f_setenv}, {"setfperm", 2, 2, FEARG_1, arg2_string, |