diff src/regexp.c @ 24488:f293bb501b30 v8.2.2784

patch 8.2.2784: Vim9: cannot use =expr in :substitute Commit: https://github.com/vim/vim/commit/4c13721482d7786f92f5a56e43b0f5c499264b7e Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 19 16:48:48 2021 +0200 patch 8.2.2784: Vim9: cannot use \=expr in :substitute Problem: Vim9: cannot use \=expr in :substitute. Solution: Compile the expression into instructions and execute them when invoked.
author Bram Moolenaar <Bram@vim.org>
date Mon, 19 Apr 2021 17:00:04 +0200
parents bb29b09902d5
children b1fa3f005c93
line wrap: on
line diff
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -2069,6 +2069,9 @@ vim_regsub_both(
 		}
 		clear_tv(&rettv);
 	    }
+	    else if (substitute_instr != NULL)
+		// Execute instructions from ISN_SUBSTITUTE.
+		eval_result = exe_substitute_instr();
 	    else
 		eval_result = eval_to_string(source + 2, TRUE);