comparison src/ex_docmd.c @ 22685:80b4e604d1d5 v8.2.1891

patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks Commit: https://github.com/vim/vim/commit/683581eb4980eda27d6438caab85c0a9cf551c24 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 22 21:22:58 2020 +0200 patch 8.2.1891: Vim9: skipping over expression doesn't handle line breaks Problem: Vim9: skipping over expression doesn't handle line breaks. Solution: Pass evalarg to skip_expr(). (closes https://github.com/vim/vim/issues/7157)
author Bram Moolenaar <Bram@vim.org>
date Thu, 22 Oct 2020 21:30:04 +0200
parents f773ac13c093
children 6fe386286ea8
comparison
equal deleted inserted replaced
22684:3d1331314be7 22685:80b4e604d1d5
638 linenr_T *breakpoint = NULL; // ptr to breakpoint field in cookie 638 linenr_T *breakpoint = NULL; // ptr to breakpoint field in cookie
639 int *dbg_tick = NULL; // ptr to dbg_tick field in cookie 639 int *dbg_tick = NULL; // ptr to dbg_tick field in cookie
640 struct dbg_stuff debug_saved; // saved things for debug mode 640 struct dbg_stuff debug_saved; // saved things for debug mode
641 int initial_trylevel; 641 int initial_trylevel;
642 msglist_T **saved_msg_list = NULL; 642 msglist_T **saved_msg_list = NULL;
643 msglist_T *private_msg_list; 643 msglist_T *private_msg_list = NULL;
644 644
645 // "fgetline" and "cookie" passed to do_one_cmd() 645 // "fgetline" and "cookie" passed to do_one_cmd()
646 char_u *(*cmd_getline)(int, void *, int, getline_opt_T); 646 char_u *(*cmd_getline)(int, void *, int, getline_opt_T);
647 void *cmd_cookie; 647 void *cmd_cookie;
648 struct loop_cookie cmd_loop_cookie; 648 struct loop_cookie cmd_loop_cookie;
662 // combine the messages stored by an earlier invocation of do_one_cmd() 662 // combine the messages stored by an earlier invocation of do_one_cmd()
663 // with the command name of the later one. This would happen when 663 // with the command name of the later one. This would happen when
664 // BufWritePost autocommands are executed after a write error. 664 // BufWritePost autocommands are executed after a write error.
665 saved_msg_list = msg_list; 665 saved_msg_list = msg_list;
666 msg_list = &private_msg_list; 666 msg_list = &private_msg_list;
667 private_msg_list = NULL;
668 #endif 667 #endif
669 668
670 // It's possible to create an endless loop with ":execute", catch that 669 // It's possible to create an endless loop with ":execute", catch that
671 // here. The value of 200 allows nested function calls, ":source", etc. 670 // here. The value of 200 allows nested function calls, ":source", etc.
672 // Allow 200 or 'maxfuncdepth', whatever is larger. 671 // Allow 200 or 'maxfuncdepth', whatever is larger.
3254 { 3253 {
3255 char_u *after = p; 3254 char_u *after = p;
3256 3255
3257 // When followed by "=" or "+=" then it is an assignment. 3256 // When followed by "=" or "+=" then it is an assignment.
3258 ++emsg_silent; 3257 ++emsg_silent;
3259 if (skip_expr(&after) == OK 3258 if (skip_expr(&after, NULL) == OK
3260 && (*after == '=' 3259 && (*after == '='
3261 || (*after != NUL && after[1] == '='))) 3260 || (*after != NUL && after[1] == '=')))
3262 eap->cmdidx = CMD_var; 3261 eap->cmdidx = CMD_var;
3263 else 3262 else
3264 eap->cmdidx = CMD_eval; 3263 eap->cmdidx = CMD_eval;
4389 #ifdef FEAT_EVAL 4388 #ifdef FEAT_EVAL
4390 // Skip over `=expr`, wildcards in it are not expanded. 4389 // Skip over `=expr`, wildcards in it are not expanded.
4391 if (p[0] == '`' && p[1] == '=') 4390 if (p[0] == '`' && p[1] == '=')
4392 { 4391 {
4393 p += 2; 4392 p += 2;
4394 (void)skip_expr(&p); 4393 (void)skip_expr(&p, NULL);
4395 if (*p == '`') 4394 if (*p == '`')
4396 ++p; 4395 ++p;
4397 continue; 4396 continue;
4398 } 4397 }
4399 #endif 4398 #endif
4664 #ifdef FEAT_EVAL 4663 #ifdef FEAT_EVAL
4665 // Skip over `=expr` when wildcards are expanded. 4664 // Skip over `=expr` when wildcards are expanded.
4666 else if (p[0] == '`' && p[1] == '=' && (eap->argt & EX_XFILE)) 4665 else if (p[0] == '`' && p[1] == '=' && (eap->argt & EX_XFILE))
4667 { 4666 {
4668 p += 2; 4667 p += 2;
4669 (void)skip_expr(&p); 4668 (void)skip_expr(&p, NULL);
4670 } 4669 }
4671 #endif 4670 #endif
4672 4671
4673 // Check for '"': start of comment or '|': next command 4672 // Check for '"': start of comment or '|': next command
4674 // :@" and :*" do not start a comment! 4673 // :@" and :*" do not start a comment!