diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-01-14 12:44:41 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-01-14 12:44:41 +0100 |
commit | 651863c94a882a97aec7968fc87a638ff78e56ff (patch) | |
tree | 8b7e256d3ed933795b4442f140930734a414863e /src/getchar.c | |
parent | 8be6388b7649d9378cd1ba1627a4b0aed61b86e7 (diff) |
updated for version 7.4.569v7.4.569
Problem: Having CTRL-C interrupt or not does not check the mode of the
mapping. (Ingo Karkat)
Solution: Use a bitmask with the map mode. (Christian Brabandt)
Diffstat (limited to 'src/getchar.c')
-rw-r--r-- | src/getchar.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/getchar.c b/src/getchar.c index 174cfa892f..3ae5f40609 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -3708,8 +3708,13 @@ do_map(maptype, arg, mode, abbrev) if (!did_it) retval = 2; /* no match */ else if (*keys == Ctrl_C) + { /* If CTRL-C has been unmapped, reuse it for Interrupting. */ - mapped_ctrl_c = FALSE; + if (map_table == curbuf->b_maphash) + curbuf->b_mapped_ctrl_c &= ~mode; + else + mapped_ctrl_c &= ~mode; + } goto theend; } @@ -3744,7 +3749,12 @@ do_map(maptype, arg, mode, abbrev) /* If CTRL-C has been mapped, don't always use it for Interrupting. */ if (*keys == Ctrl_C) - mapped_ctrl_c = TRUE; + { + if (map_table == curbuf->b_maphash) + curbuf->b_mapped_ctrl_c |= mode; + else + mapped_ctrl_c |= mode; + } mp->m_keys = vim_strsave(keys); mp->m_str = vim_strsave(rhs); |