Problem: In the GUI a modifier is not recognized for the key typed after
CTRL-X, which may result in a mapping to be used. (Daniel
Steinberg)
Solution: Recognize a modifier starting with CSI. (closes #9889)
int c = *p;
if (typebuf.tb_len > 3
- && c == K_SPECIAL
+ && (c == K_SPECIAL || c == CSI) // CSI is used by the GUI
&& p[1] == KS_MODIFIER
&& (p[2] & MOD_MASK_CTRL))
c = p[3] & 0x1f;
exe "normal owh\<C-X>\<C-K>"
exe "normal owh\<C-N>"
call assert_equal(currmess, execute('messages'))
- close!
+ bwipe!
+endfunc
+
+" A mapping is not used for the key after CTRL-X.
+func Test_no_mapping_for_ctrl_x_key()
+ new
+ inoremap <C-K> <Cmd>let was_mapped = 'yes'<CR>
+ setlocal dictionary=README.txt
+ call feedkeys("aexam\<C-X>\<C-K> ", 'xt')
+ call assert_equal('example ', getline(1))
+ call assert_false(exists('was_mapped'))
+ bwipe!
endfunc
" Test for different ways of setting the 'completefunc' option
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4502,
/**/
4501,
/**/