Patch 8.1.2261

6 views
Skip to first unread message

Bram Moolenaar

unread,
Nov 6, 2019, 7:59:52 AM11/6/19
to vim...@googlegroups.com

Patch 8.1.2261
Problem: With modifyOtherKeys set 'noesckeys' doesn't work. (James McCoy)
Solution: Disable modifyOtherKeys while in Insert mode when 'noesckeys' is
set. (closes #5180)
Files: src/edit.c, src/testdir/test_edit.vim


*** ../vim-8.1.2260/src/edit.c 2019-10-17 22:58:59.062497024 +0200
--- src/edit.c 2019-11-06 13:38:22.908523034 +0100
***************
*** 323,332 ****
revins_scol = -1;
#endif
if (!p_ek)
! /* Disable bracketed paste mode, we won't recognize the escape
! * sequences. */
out_str(T_BD);

/*
* Handle restarting Insert mode.
* Don't do this for "CTRL-O ." (repeat an insert): In that case we get
--- 323,338 ----
revins_scol = -1;
#endif
if (!p_ek)
! {
! // Disable bracketed paste mode, we won't recognize the escape
! // sequences.
out_str(T_BD);

+ // Disable modifyOtherKeys, keys with modifiers would cause exiting
+ // Insert mode.
+ out_str(T_CTE);
+ }
+
/*
* Handle restarting Insert mode.
* Don't do this for "CTRL-O ." (repeat an insert): In that case we get
***************
*** 4220,4231 ****

setmouse();
#ifdef CURSOR_SHAPE
! ui_cursor_shape(); /* may show different cursor shape */
#endif
if (!p_ek)
! /* Re-enable bracketed paste mode. */
out_str(T_BE);

// When recording or for CTRL-O, need to display the new mode.
// Otherwise remove the mode message.
if (reg_recording != 0 || restart_edit != NUL)
--- 4226,4242 ----

setmouse();
#ifdef CURSOR_SHAPE
! ui_cursor_shape(); // may show different cursor shape
#endif
if (!p_ek)
! {
! // Re-enable bracketed paste mode.
out_str(T_BE);

+ // Re-enable modifyOtherKeys.
+ out_str(T_CTI);
+ }
+
// When recording or for CTRL-O, need to display the new mode.
// Otherwise remove the mode message.
if (reg_recording != 0 || restart_edit != NUL)
***************
*** 4233,4239 ****
else if (p_smd && (got_int || !skip_showmode()))
msg("");

! return TRUE; /* exit Insert mode */
}

#ifdef FEAT_RIGHTLEFT
--- 4244,4250 ----
else if (p_smd && (got_int || !skip_showmode()))
msg("");

! return TRUE; // exit Insert mode
}

#ifdef FEAT_RIGHTLEFT
*** ../vim-8.1.2260/src/testdir/test_edit.vim 2019-09-05 21:28:58.495157310 +0200
--- src/testdir/test_edit.vim 2019-11-06 13:58:20.830567076 +0100
***************
*** 1495,1497 ****
--- 1495,1516 ----
set backspace&
bwipe!
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
*** ../vim-8.1.2260/src/version.c 2019-11-05 22:38:43.845777457 +0100
--- src/version.c 2019-11-06 13:39:43.180052938 +0100
***************
*** 743,744 ****
--- 743,746 ----
{ /* Add new patch number below this line */
+ /**/
+ 2261,
/**/

--
hundred-and-one symptoms of being an internet addict:
37. You start looking for hot HTML addresses in public restrooms.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages