1
0
forked from aniani/vim

patch 8.2.4870: Vim9: expression in :substitute is not compiled

Problem:    Vim9: expression in :substitute is not compiled.
Solution:   Use an INSTR instruction if possible. (closes #10334)
This commit is contained in:
LemonBoy
2022-05-05 13:53:03 +01:00
committed by Bram Moolenaar
parent e442d59f6d
commit f3b4895f27
7 changed files with 82 additions and 14 deletions

View File

@@ -9966,7 +9966,9 @@ f_substitute(typval_T *argvars, typval_T *rettv)
pat = tv_get_string_buf_chk(&argvars[1], patbuf);
flg = tv_get_string_buf_chk(&argvars[3], flagsbuf);
if (argvars[2].v_type == VAR_FUNC || argvars[2].v_type == VAR_PARTIAL)
if (argvars[2].v_type == VAR_FUNC
|| argvars[2].v_type == VAR_PARTIAL
|| argvars[2].v_type == VAR_INSTR)
expr = &argvars[2];
else
sub = tv_get_string_buf_chk(&argvars[2], subbuf);