Mercurial > vim
diff src/evalfunc.c @ 24838:3f9053c21765 v8.2.2957
patch 8.2.2957: using getchar() in Vim9 script is problematic
Commit: https://github.com/vim/vim/commit/3a7503c34c65ed15cc08deb5b54aaf2ea51525b4
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 7 18:29:17 2021 +0200
patch 8.2.2957: using getchar() in Vim9 script is problematic
Problem: Using getchar() in Vim9 script is problematic.
Solution: Add getcharstr(). (closes https://github.com/vim/vim/issues/8343)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 07 Jun 2021 18:30:04 +0200 |
parents | 5f8dd7b3ae41 |
children | fdc6a7769045 |
line wrap: on
line diff
--- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -945,13 +945,15 @@ static funcentry_T global_functions[] = {"getchangelist", 0, 1, FEARG_1, NULL, ret_list_any, f_getchangelist}, {"getchar", 0, 1, 0, NULL, - ret_number, f_getchar}, + ret_any, f_getchar}, {"getcharmod", 0, 0, 0, NULL, ret_number, f_getcharmod}, {"getcharpos", 1, 1, FEARG_1, NULL, ret_list_number, f_getcharpos}, {"getcharsearch", 0, 0, 0, NULL, ret_dict_any, f_getcharsearch}, + {"getcharstr", 0, 1, 0, NULL, + ret_string, f_getcharstr}, {"getcmdline", 0, 0, 0, NULL, ret_string, f_getcmdline}, {"getcmdpos", 0, 0, 0, NULL,