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)
diff --git a/src/normal.c b/src/normal.c
index fb2bced..8351685 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1466,6 +1466,13 @@
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('"');