diff src/normal.c @ 30102:539fb427124d v9.0.0387

patch 9.0.0387: repeat <ScriptCmd> mapping doesn't use right script context Commit: https://github.com/vim/vim/commit/ddf7dba96e05a41c7a228b153146237e0a21b146 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 5 16:53:21 2022 +0100 patch 9.0.0387: repeat <ScriptCmd> mapping doesn't use right script context Problem: repeating a <ScriptCmd> mapping does not use the right script context. Solution: When using a mapping put <SID>{sid}; in the redo buffer. (closes #11049)
author Bram Moolenaar <Bram@vim.org>
date Mon, 05 Sep 2022 18:00:05 +0200
parents bb0e525e1393
children 914b3c64ab92
line wrap: on
line diff
--- a/src/normal.c
+++ b/src/normal.c
@@ -1466,6 +1466,13 @@ prep_redo_num2(
     int	    cmd5)
 {
     ResetRedobuff();
+
+#ifdef FEAT_EVAL
+    // Put info about a mapping in the redo buffer, so that "." will use the
+    // same script context.
+    may_add_last_used_map_to_redobuff();
+#endif
+
     if (regname != 0)	// yank from specified buffer
     {
 	AppendCharToRedobuff('"');