forked from aniani/vim
patch 8.1.2261: with modifyOtherKeys set 'noesckeys' doesn't work
Problem: With modifyOtherKeys set 'noesckeys' doesn't work. (James McCoy) Solution: Disable modifyOtherKeys while in Insert mode when 'noesckeys' is set. (closes #5180)
This commit is contained in:
parent
36ec6f6953
commit
177c9f2f06
21
src/edit.c
21
src/edit.c
@ -323,10 +323,16 @@ edit(
|
|||||||
revins_scol = -1;
|
revins_scol = -1;
|
||||||
#endif
|
#endif
|
||||||
if (!p_ek)
|
if (!p_ek)
|
||||||
/* Disable bracketed paste mode, we won't recognize the escape
|
{
|
||||||
* sequences. */
|
// Disable bracketed paste mode, we won't recognize the escape
|
||||||
|
// sequences.
|
||||||
out_str(T_BD);
|
out_str(T_BD);
|
||||||
|
|
||||||
|
// Disable modifyOtherKeys, keys with modifiers would cause exiting
|
||||||
|
// Insert mode.
|
||||||
|
out_str(T_CTE);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle restarting Insert mode.
|
* Handle restarting Insert mode.
|
||||||
* Don't do this for "CTRL-O ." (repeat an insert): In that case we get
|
* Don't do this for "CTRL-O ." (repeat an insert): In that case we get
|
||||||
@ -4220,12 +4226,17 @@ ins_esc(
|
|||||||
|
|
||||||
setmouse();
|
setmouse();
|
||||||
#ifdef CURSOR_SHAPE
|
#ifdef CURSOR_SHAPE
|
||||||
ui_cursor_shape(); /* may show different cursor shape */
|
ui_cursor_shape(); // may show different cursor shape
|
||||||
#endif
|
#endif
|
||||||
if (!p_ek)
|
if (!p_ek)
|
||||||
/* Re-enable bracketed paste mode. */
|
{
|
||||||
|
// Re-enable bracketed paste mode.
|
||||||
out_str(T_BE);
|
out_str(T_BE);
|
||||||
|
|
||||||
|
// Re-enable modifyOtherKeys.
|
||||||
|
out_str(T_CTI);
|
||||||
|
}
|
||||||
|
|
||||||
// When recording or for CTRL-O, need to display the new mode.
|
// When recording or for CTRL-O, need to display the new mode.
|
||||||
// Otherwise remove the mode message.
|
// Otherwise remove the mode message.
|
||||||
if (reg_recording != 0 || restart_edit != NUL)
|
if (reg_recording != 0 || restart_edit != NUL)
|
||||||
@ -4233,7 +4244,7 @@ ins_esc(
|
|||||||
else if (p_smd && (got_int || !skip_showmode()))
|
else if (p_smd && (got_int || !skip_showmode()))
|
||||||
msg("");
|
msg("");
|
||||||
|
|
||||||
return TRUE; /* exit Insert mode */
|
return TRUE; // exit Insert mode
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_RIGHTLEFT
|
#ifdef FEAT_RIGHTLEFT
|
||||||
|
@ -1495,3 +1495,22 @@ func Test_edit_startinsert()
|
|||||||
set backspace&
|
set backspace&
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_edit_noesckeys()
|
||||||
|
new
|
||||||
|
|
||||||
|
" <Left> moves cursor when 'esckeys' is set
|
||||||
|
exe "set t_kl=\<Esc>OD"
|
||||||
|
set esckeys
|
||||||
|
call feedkeys("axyz\<Esc>ODX", "xt")
|
||||||
|
call assert_equal("xyXz", getline(1))
|
||||||
|
|
||||||
|
" <Left> exits Insert mode when 'esckeys' is off
|
||||||
|
set noesckeys
|
||||||
|
call setline(1, '')
|
||||||
|
call feedkeys("axyz\<Esc>ODX", "xt")
|
||||||
|
call assert_equal(["DX", "xyz"], getline(1, 2))
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
set esckeys
|
||||||
|
endfunc
|
||||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2261,
|
||||||
/**/
|
/**/
|
||||||
2260,
|
2260,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user