From ddf7dba96e05a41c7a228b153146237e0a21b146 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 5 Sep 2022 16:53:21 +0100 Subject: patch 9.0.0387: repeat mapping doesn't use right script context Problem: repeating a mapping does not use the right script context. Solution: When using a mapping put {sid}; in the redo buffer. (closes #11049) --- src/normal.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/normal.c') diff --git a/src/normal.c b/src/normal.c index fb2bced04..8351685d1 100644 --- 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('"'); -- cgit v1.2.1