comparison src/eval.c @ 20142:fe8d0a4344df v8.2.0626

patch 8.2.0626: Vim9: wrong syntax of function in Vim9 script Commit: https://github.com/vim/vim/commit/f93c7fea084a99848d512ff2732041d4b41d93c8 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 23 22:16:53 2020 +0200 patch 8.2.0626: Vim9: wrong syntax of function in Vim9 script Problem: Vim9: wrong syntax of function in Vim9 script. Solution: Give error for missing space. Implement :echomsg and :echoerr. (closes #5670)
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Apr 2020 22:30:03 +0200
parents 0b35a7ffceb2
children 49694eceaa55
comparison
equal deleted inserted replaced
20141:3be7dea7ddcc 20142:fe8d0a4344df
31 * When recursively copying lists and dicts we need to remember which ones we 31 * When recursively copying lists and dicts we need to remember which ones we
32 * have done to avoid endless recursiveness. This unique ID is used for that. 32 * have done to avoid endless recursiveness. This unique ID is used for that.
33 * The last bit is used for previous_funccal, ignored when comparing. 33 * The last bit is used for previous_funccal, ignored when comparing.
34 */ 34 */
35 static int current_copyID = 0; 35 static int current_copyID = 0;
36
37 static int echo_attr = 0; // attributes used for ":echo"
38 36
39 /* 37 /*
40 * Info used by a ":for" loop. 38 * Info used by a ":for" loop.
41 */ 39 */
42 typedef struct 40 typedef struct
6143 typval_T rettv; 6141 typval_T rettv;
6144 int ret = OK; 6142 int ret = OK;
6145 char_u *p; 6143 char_u *p;
6146 garray_T ga; 6144 garray_T ga;
6147 int len; 6145 int len;
6148 int save_did_emsg;
6149 6146
6150 ga_init2(&ga, 1, 80); 6147 ga_init2(&ga, 1, 80);
6151 6148
6152 if (eap->skip) 6149 if (eap->skip)
6153 ++emsg_skip; 6150 ++emsg_skip;
6211 msg_attr(ga.ga_data, echo_attr); 6208 msg_attr(ga.ga_data, echo_attr);
6212 out_flush(); 6209 out_flush();
6213 } 6210 }
6214 else if (eap->cmdidx == CMD_echoerr) 6211 else if (eap->cmdidx == CMD_echoerr)
6215 { 6212 {
6213 int save_did_emsg = did_emsg;
6214
6216 // We don't want to abort following commands, restore did_emsg. 6215 // We don't want to abort following commands, restore did_emsg.
6217 save_did_emsg = did_emsg;
6218 emsg(ga.ga_data); 6216 emsg(ga.ga_data);
6219 if (!force_abort) 6217 if (!force_abort)
6220 did_emsg = save_did_emsg; 6218 did_emsg = save_did_emsg;
6221 } 6219 }
6222 else if (eap->cmdidx == CMD_execute) 6220 else if (eap->cmdidx == CMD_execute)