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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user