summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-06 13:59:16 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-06 13:59:16 +0100
commit177c9f2f06b048f4c1e154d29423edf65b128f8c (patch)
tree4443782218352de1bf06af4273647e1228de87cb /src/edit.c
parent36ec6f6953043270630159a61438ce558552fe3a (diff)
downloadvim-git-177c9f2f06b048f4c1e154d29423edf65b128f8c.tar.gz
patch 8.1.2261: with modifyOtherKeys set 'noesckeys' doesn't workv8.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)
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/edit.c b/src/edit.c
index 4cbfc773b..7786528d4 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -323,10 +323,16 @@ edit(
revins_scol = -1;
#endif
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);
+ // 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,12 +4226,17 @@ ins_esc(
setmouse();
#ifdef CURSOR_SHAPE
- ui_cursor_shape(); /* may show different cursor shape */
+ ui_cursor_shape(); // may show different cursor shape
#endif
if (!p_ek)
- /* Re-enable bracketed paste mode. */
+ {
+ // 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,7 +4244,7 @@ ins_esc(
else if (p_smd && (got_int || !skip_showmode()))
msg("");
- return TRUE; /* exit Insert mode */
+ return TRUE; // exit Insert mode
}
#ifdef FEAT_RIGHTLEFT