diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-07 22:09:46 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-04-07 22:09:46 +0100 |
commit | bfc7cbd1d44e53e844a079d8ad16ae990dad664d (patch) | |
tree | 48b6f03687d9f05e58fd1378dac657c506e79ffc /src/map.c | |
parent | b6ebe5af74a965d703eb8ee66a07c97b0bbe6e58 (diff) |
patch 9.0.1442: mapset() does not restore non-script contextv9.0.1442
Problem: mapset() does not restore non-script context.
Solution: Also accept negative sid. (closes #12132)
Diffstat (limited to 'src/map.c')
-rw-r--r-- | src/map.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -227,7 +227,7 @@ map_add( int is_abbr, #ifdef FEAT_EVAL int expr, - scid_T sid, // -1 to use current_sctx + scid_T sid, // 0 to use current_sctx int scriptversion, linenr_T lnum, #endif @@ -266,7 +266,7 @@ map_add( mp->m_simplified = simplified; #ifdef FEAT_EVAL mp->m_expr = expr; - if (sid > 0) + if (sid != 0) { mp->m_script_ctx.sc_sid = sid; mp->m_script_ctx.sc_lnum = lnum; @@ -924,7 +924,7 @@ do_map( if (map_add(map_table, abbr_table, keys, rhs, orig_rhs, noremap, nowait, silent, mode, abbrev, #ifdef FEAT_EVAL - expr, /* sid */ -1, /* scriptversion */ 0, /* lnum */ 0, + expr, /* sid */ 0, /* scriptversion */ 0, /* lnum */ 0, #endif keyround1_simplified) == FAIL) { |