vim-patch:7.4.569/573

vim-patch:7.4.569
vim-patch:7.4.573
Helped-by: @glts https://github.com/neovim/neovim/pull/2621

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)

651863c94a

Problem:    Mapping CTRL-C in Visual mode doesn't work. (Ingo Karkat)
Solution:   Call get_real_state() instead of using State directly.

5000869712
This commit is contained in:
Shougo Matsushita
2015-12-19 10:03:17 +09:00
committed by Justin M. Keyes
parent 420fe1fe73
commit 3dfbeabf35
8 changed files with 67 additions and 15 deletions

View File

@@ -2941,7 +2941,10 @@ do_map (
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;
}
@@ -2966,9 +2969,13 @@ do_map (
*/
mp = xmalloc(sizeof(mapblock_T));
/* If CTRL-C has been mapped, don't always use it for Interrupting. */
if (*keys == Ctrl_C)
mapped_ctrl_c = TRUE;
// If CTRL-C has been mapped, don't always use it for Interrupting.
if (*keys == Ctrl_C) {
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);