Mercurial > vim
comparison src/vim9execute.c @ 24590:2818f846f099 v8.2.2834
patch 8.2.2834: Vim9: :cexpr does not work with local variables
Commit: https://github.com/vim/vim/commit/5f7d4c049e934dbc8d2c3f2720797c10ee3c55c2
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed May 5 21:31:39 2021 +0200
patch 8.2.2834: Vim9: :cexpr does not work with local variables
Problem: Vim9: :cexpr does not work with local variables.
Solution: Compile :cexpr.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 05 May 2021 21:45:04 +0200 |
parents | dd87d08f86de |
children | 5c456a88f651 |
comparison
equal
deleted
inserted
replaced
24589:c770bde164ea | 24590:2818f846f099 |
---|---|
1437 } | 1437 } |
1438 tv = STACK_TV_BOT(0); | 1438 tv = STACK_TV_BOT(0); |
1439 tv->v_type = VAR_STRING; | 1439 tv->v_type = VAR_STRING; |
1440 tv->vval.v_string = res; | 1440 tv->vval.v_string = res; |
1441 ++ectx->ec_stack.ga_len; | 1441 ++ectx->ec_stack.ga_len; |
1442 } | |
1443 break; | |
1444 | |
1445 case ISN_CEXPR_AUCMD: | |
1446 if (trigger_cexpr_autocmd(iptr->isn_arg.number) == FAIL) | |
1447 goto on_error; | |
1448 break; | |
1449 | |
1450 case ISN_CEXPR_CORE: | |
1451 { | |
1452 exarg_T ea; | |
1453 int res; | |
1454 | |
1455 CLEAR_FIELD(ea); | |
1456 ea.cmdidx = iptr->isn_arg.cexpr.cexpr_ref->cer_cmdidx; | |
1457 ea.forceit = iptr->isn_arg.cexpr.cexpr_ref->cer_forceit; | |
1458 ea.cmdlinep = &iptr->isn_arg.cexpr.cexpr_ref->cer_cmdline; | |
1459 --ectx->ec_stack.ga_len; | |
1460 tv = STACK_TV_BOT(0); | |
1461 res = cexpr_core(&ea, tv); | |
1462 clear_tv(tv); | |
1463 if (res == FAIL) | |
1464 goto on_error; | |
1442 } | 1465 } |
1443 break; | 1466 break; |
1444 | 1467 |
1445 // execute Ex command from pieces on the stack | 1468 // execute Ex command from pieces on the stack |
1446 case ISN_EXECCONCAT: | 1469 case ISN_EXECCONCAT: |
4389 break; | 4412 break; |
4390 case ISN_REDIREND: | 4413 case ISN_REDIREND: |
4391 smsg("%s%4d REDIR END%s", pfx, current, | 4414 smsg("%s%4d REDIR END%s", pfx, current, |
4392 iptr->isn_arg.number ? " append" : ""); | 4415 iptr->isn_arg.number ? " append" : ""); |
4393 break; | 4416 break; |
4417 case ISN_CEXPR_AUCMD: | |
4418 smsg("%s%4d CEXPR pre %s", pfx, current, | |
4419 cexpr_get_auname(iptr->isn_arg.number)); | |
4420 break; | |
4421 case ISN_CEXPR_CORE: | |
4422 { | |
4423 cexprref_T *cer = iptr->isn_arg.cexpr.cexpr_ref; | |
4424 | |
4425 smsg("%s%4d CEXPR core %s%s \"%s\"", pfx, current, | |
4426 cexpr_get_auname(cer->cer_cmdidx), | |
4427 cer->cer_forceit ? "!" : "", | |
4428 cer->cer_cmdline); | |
4429 } | |
4430 break; | |
4394 case ISN_SUBSTITUTE: | 4431 case ISN_SUBSTITUTE: |
4395 { | 4432 { |
4396 subs_T *subs = &iptr->isn_arg.subs; | 4433 subs_T *subs = &iptr->isn_arg.subs; |
4397 | 4434 |
4398 smsg("%s%4d SUBSTITUTE %s", pfx, current, subs->subs_cmd); | 4435 smsg("%s%4d SUBSTITUTE %s", pfx, current, subs->subs_cmd); |