terminal: less babysitting of mapped_ctrl_c

process_interrupts() checks get_real_state() so we can avoid some
housekeeping of mapped_ctrl_c in terminal-mode.
This commit is contained in:
Justin M. Keyes
2016-01-13 00:39:54 -05:00
parent 3dfbeabf35
commit 8eeda7169a
4 changed files with 17 additions and 22 deletions

View File

@@ -2940,11 +2940,12 @@ do_map (
if (!did_it) {
retval = 2; /* no match */
} else if (*keys == Ctrl_C) {
/* If CTRL-C has been unmapped, reuse it for Interrupting. */
if (map_table == curbuf->b_maphash)
// If CTRL-C has been unmapped, reuse it for Interrupting.
if (map_table == curbuf->b_maphash) {
curbuf->b_mapped_ctrl_c &= ~mode;
else
} else {
mapped_ctrl_c &= ~mode;
}
}
goto theend;
}
@@ -2971,10 +2972,11 @@ do_map (
// If CTRL-C has been mapped, don't always use it for Interrupting.
if (*keys == Ctrl_C) {
if (map_table == curbuf->b_maphash)
if (map_table == curbuf->b_maphash) {
curbuf->b_mapped_ctrl_c |= mode;
else
} else {
mapped_ctrl_c |= mode;
}
}
mp->m_keys = vim_strsave(keys);