diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2022-08-27 12:22:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-27 12:22:25 +0100 |
commit | 07ea5f1509fe8dafe3262ed2702b4d0fc99e288b (patch) | |
tree | 1b409138b5a115619cb2852ece07194edca7ed51 /src/evalfunc.c | |
parent | 5ff595d9db2d9a33aa10cc9f18f256826226862f (diff) |
patch 9.0.0285: it is not easy to change the command line from a pluginv9.0.0285
Problem: It is not easy to change the command line from a plugin.
Solution: Add setcmdline(). (Shougo Matsushita, closes #10869)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index d2cc8fc769..1b629ff843 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -2369,6 +2369,8 @@ static funcentry_T global_functions[] = ret_number_bool, f_setcharpos}, {"setcharsearch", 1, 1, FEARG_1, arg1_dict_any, ret_void, f_setcharsearch}, + {"setcmdline", 1, 2, FEARG_1, arg2_string_number, + ret_number_bool, f_setcmdline}, {"setcmdpos", 1, 1, FEARG_1, arg1_number, ret_number_bool, f_setcmdpos}, {"setcursorcharpos", 1, 3, FEARG_1, arg13_cursor, @@ -3607,7 +3609,6 @@ f_debugbreak(typval_T *argvars, typval_T *rettv) f_deepcopy(typval_T *argvars, typval_T *rettv) { varnumber_T noref = 0; - int copyID; if (in_vim9script() && (check_for_opt_bool_arg(argvars, 1) == FAIL)) @@ -3618,10 +3619,8 @@ f_deepcopy(typval_T *argvars, typval_T *rettv) if (noref < 0 || noref > 1) semsg(_(e_using_number_as_bool_nr), noref); else - { - copyID = get_copyID(); - item_copy(&argvars[0], rettv, TRUE, TRUE, noref == 0 ? copyID : 0); - } + item_copy(&argvars[0], rettv, TRUE, TRUE, + noref == 0 ? get_copyID() : 0); } /* |