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;
}
/* 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);
#ifdef USE_ON_FLY_SCROLL
EXTERN int dont_scroll INIT(= FALSE);/* don't use scrollbars when TRUE */
#endif
-EXTERN int mapped_ctrl_c INIT(= FALSE); /* CTRL-C is mapped */
+EXTERN int mapped_ctrl_c INIT(= FALSE); /* modes where CTRL-C is mapped */
EXTERN int ctrl_c_interrupts INIT(= TRUE); /* CTRL-C sets got_int */
EXTERN cmdmod_T cmdmod; /* Ex command modifiers */
cryptstate_T *b_cryptstate; /* Encryption state while reading or writing
* the file. NULL when not using encryption. */
#endif
+ int b_mapped_ctrl_c; /* modes where CTRL-C is mapped */
}; /* file_buffer */
:inoreab чкпр vim
GAчкпр
\e
+:" mapping of ctrl-c in insert mode
+:set cpo-=< cpo-=k
+:inoremap <c-c> <ctrl-c>
+:cnoremap <c-c> dummy
+:cunmap <c-c>
+GA
+TEST2: CTRL-C |\ 3A|
+\e
+:nunmap <c-c>
: " langmap should not get remapped in insert mode
:inoremap { FAIL_ilangmap
test starts here:
vim
+TEST2: CTRL-C |<ctrl-c>A|
+
+
+
/* ... there is no need for CTRL-C to interrupt something, don't let
* it set got_int when it was mapped. */
- if (mapped_ctrl_c)
+ if ((mapped_ctrl_c | curbuf->b_mapped_ctrl_c) & State)
ctrl_c_interrupts = FALSE;
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 569,
/**/
568,
/**/