comparison src/vim9compile.c @ 24834:adcd50a18236 v8.2.2955

patch 8.2.2955: Vim9: using filter in compiled command does not work Commit: https://github.com/vim/vim/commit/e729ce294f9756165020ad86e3b98b4112e1a6ab Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 6 21:38:09 2021 +0200 patch 8.2.2955: Vim9: using filter in compiled command does not work Problem: Vim9: using filter in compiled command does not work. Solution: Generate EXEC including the command modifier.
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Jun 2021 21:45:03 +0200
parents a8d64f1a223b
children 3c8bd1d392d1
comparison
equal deleted inserted replaced
24833:d672d5756394 24834:adcd50a18236
8534 * A command that is not compiled, execute with legacy code. 8534 * A command that is not compiled, execute with legacy code.
8535 */ 8535 */
8536 static char_u * 8536 static char_u *
8537 compile_exec(char_u *line, exarg_T *eap, cctx_T *cctx) 8537 compile_exec(char_u *line, exarg_T *eap, cctx_T *cctx)
8538 { 8538 {
8539 char_u *p; 8539 char_u *p;
8540 int has_expr = FALSE; 8540 int has_expr = FALSE;
8541 char_u *nextcmd = (char_u *)""; 8541 char_u *nextcmd = (char_u *)"";
8542 8542
8543 if (cctx->ctx_skip == SKIP_YES) 8543 if (cctx->ctx_skip == SKIP_YES)
8544 goto theend; 8544 goto theend;
8545
8546 // If there was a prececing command modifier, drop it and include it in the
8547 // EXEC command.
8548 if (cctx->ctx_has_cmdmod)
8549 {
8550 garray_T *instr = &cctx->ctx_instr;
8551 isn_T *isn = ((isn_T *)instr->ga_data) + instr->ga_len - 1;
8552
8553 if (isn->isn_type == ISN_CMDMOD)
8554 {
8555 vim_regfree(isn->isn_arg.cmdmod.cf_cmdmod
8556 ->cmod_filter_regmatch.regprog);
8557 vim_free(isn->isn_arg.cmdmod.cf_cmdmod);
8558 --instr->ga_len;
8559 cctx->ctx_has_cmdmod = FALSE;
8560 }
8561 }
8545 8562
8546 if (eap->cmdidx >= 0 && eap->cmdidx < CMD_SIZE) 8563 if (eap->cmdidx >= 0 && eap->cmdidx < CMD_SIZE)
8547 { 8564 {
8548 long argt = eap->argt; 8565 long argt = eap->argt;
8549 int usefilter = FALSE; 8566 int usefilter = FALSE;