diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-01-13 00:39:54 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-01-13 02:40:57 -0500 |
commit | 8eeda7169aa47881f0b6d697e291a1ef85c43e4e (patch) | |
tree | cbce774bee0feea6769fba009b271af32f53e9c2 /src/nvim/getchar.c | |
parent | 3dfbeabf35dbfe5494a4adce7b4d94d56bbe0171 (diff) | |
download | rneovim-8eeda7169aa47881f0b6d697e291a1ef85c43e4e.tar.gz rneovim-8eeda7169aa47881f0b6d697e291a1ef85c43e4e.tar.bz2 rneovim-8eeda7169aa47881f0b6d697e291a1ef85c43e4e.zip |
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.
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 008c6cecd5..89d22ad811 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -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); |