summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-11 11:58:19 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-11 11:58:19 +0000
commit19db9e6ba710ca32f0f5e0c2ca2ba69f8228b833 (patch)
tree985829b16070d2e27065d670fcb2ed42a03e160e /src/getchar.c
parent762838218feb223f53ab87d80928dadd991a1746 (diff)
patch 8.2.4059: Vim9: an expression of a map cannot access script-local itemsv8.2.4059
Problem: Vim9: an expression of a map cannot access script-local items. (Maxim Kim) Solution: Use the script ID of where the map was defined.
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 6fecc1a289..08c1a95578 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2785,7 +2785,6 @@ handle_mapping(
int save_m_noremap;
int save_m_silent;
char_u *save_m_keys;
- char_u *save_m_str;
#else
# define save_m_noremap mp->m_noremap
# define save_m_silent mp->m_silent
@@ -2834,7 +2833,6 @@ handle_mapping(
save_m_noremap = mp->m_noremap;
save_m_silent = mp->m_silent;
save_m_keys = NULL; // only saved when needed
- save_m_str = NULL; // only saved when needed
/*
* Handle ":map <expr>": evaluate the {rhs} as an expression. Also
@@ -2851,8 +2849,7 @@ handle_mapping(
may_garbage_collect = FALSE;
save_m_keys = vim_strsave(mp->m_keys);
- save_m_str = vim_strsave(mp->m_str);
- map_str = eval_map_expr(save_m_str, NUL);
+ map_str = eval_map_expr(mp, NUL);
// The mapping may do anything, but we expect it to take care of
// redrawing. Do put the cursor back where it was.
@@ -2900,7 +2897,6 @@ handle_mapping(
}
#ifdef FEAT_EVAL
vim_free(save_m_keys);
- vim_free(save_m_str);
#endif
*keylenp = keylen;
if (i == FAIL)