diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-12-29 23:04:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-12-29 23:04:25 +0100 |
commit | 1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506 (patch) | |
tree | 8f5dc27f3eeea927ad3ca8de42fe0df06a041dd5 /src/map.c | |
parent | 257a396879ff67a0482841a39237f30a8e1e27c5 (diff) | |
download | vim-git-1a47ae32cdc19b0fd5a82e19fe5fddf45db1a506.tar.gz |
patch 8.2.0056: execution stack is incomplete and inefficientv8.2.0056
Problem: Execution stack is incomplete and inefficient.
Solution: Introduce a proper execution stack and use it instead of
sourcing_name/sourcing_lnum. Create a string only when used.
Diffstat (limited to 'src/map.c')
-rw-r--r-- | src/map.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -697,7 +697,7 @@ do_map( #ifdef FEAT_EVAL mp->m_expr = expr; mp->m_script_ctx = current_sctx; - mp->m_script_ctx.sc_lnum += sourcing_lnum; + mp->m_script_ctx.sc_lnum += SOURCING_LNUM; #endif did_it = TRUE; } @@ -796,7 +796,7 @@ do_map( #ifdef FEAT_EVAL mp->m_expr = expr; mp->m_script_ctx = current_sctx; - mp->m_script_ctx.sc_lnum += sourcing_lnum; + mp->m_script_ctx.sc_lnum += SOURCING_LNUM; #endif // add the new entry in front of the abbrlist or maphash[] list @@ -1915,14 +1915,13 @@ check_map_keycodes(void) char_u *p; int i; char_u buf[3]; - char_u *save_name; int abbr; int hash; buf_T *bp; validate_maphash(); - save_name = sourcing_name; - sourcing_name = (char_u *)"mappings"; // avoids giving error messages + // avoids giving error messages + estack_push(ETYPE_INTERNAL, (char_u *)"mappings", 0); // Do this once for each buffer, and then once for global // mappings/abbreviations with bp == NULL @@ -1979,7 +1978,7 @@ check_map_keycodes(void) if (bp == NULL) break; } - sourcing_name = save_name; + estack_pop(); } #if defined(FEAT_EVAL) || defined(PROTO) |