summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-04-20 23:38:07 +0200
committerBram Moolenaar <Bram@vim.org>2019-04-20 23:38:07 +0200
commit4c25bd785aa8b565bf973cbba12ed36b76daaa4f (patch)
treed072619d2aa7ed227975f21552119805f4b7f398 /src/screen.c
parent0fdd94359511f295d93e488d60ca3b0d40ea1cfa (diff)
downloadvim-git-4c25bd785aa8b565bf973cbba12ed36b76daaa4f.tar.gz
patch 8.1.1192: mode is not cleared when leaving Insert mode with mapped Escv8.1.1192
Problem: Mode is not cleared when leaving Insert mode with mapped Esc. Solution: Clear the mode when redraw_cmdline is set. (closes #4269)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/screen.c b/src/screen.c
index 1c21b7430..67a0db943 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -790,7 +790,7 @@ update_screen(int type_arg)
/* Clear or redraw the command line. Done last, because scrolling may
* mess up the command line. */
- if (clear_cmdline || redraw_cmdline)
+ if (clear_cmdline || redraw_cmdline || redraw_mode)
showmode();
if (no_update)
@@ -857,7 +857,7 @@ update_prepare(void)
static void
update_finish(void)
{
- if (redraw_cmdline)
+ if (redraw_cmdline || redraw_mode)
showmode();
# ifdef FEAT_SEARCH_EXTRA
@@ -10128,7 +10128,7 @@ skip_showmode()
|| !redrawing()
|| (char_avail() && !KeyTyped))
{
- redraw_cmdline = TRUE; // show mode later
+ redraw_mode = TRUE; // show mode later
return TRUE;
}
return FALSE;
@@ -10140,6 +10140,7 @@ skip_showmode()
* If clear_cmdline is TRUE, clear the rest of the cmdline.
* If clear_cmdline is FALSE there may be a message there that needs to be
* cleared only if a mode is shown.
+ * If redraw_mode is TRUE show or clear the mode.
* Return the length of the message (0 if no message).
*/
int
@@ -10313,7 +10314,7 @@ showmode(void)
}
mode_displayed = TRUE;
- if (need_clear || clear_cmdline)
+ if (need_clear || clear_cmdline || redraw_mode)
msg_clr_eos();
msg_didout = FALSE; /* overwrite this message */
length = msg_col;
@@ -10323,6 +10324,11 @@ showmode(void)
else if (clear_cmdline && msg_silent == 0)
/* Clear the whole command line. Will reset "clear_cmdline". */
msg_clr_cmdline();
+ else if (redraw_mode)
+ {
+ msg_pos_mode();
+ msg_clr_eos();
+ }
#ifdef FEAT_CMDL_INFO
/* In Visual mode the size of the selected area must be redrawn. */
@@ -10335,6 +10341,7 @@ showmode(void)
win_redr_ruler(lastwin, TRUE, FALSE);
#endif
redraw_cmdline = FALSE;
+ redraw_mode = FALSE;
clear_cmdline = FALSE;
return length;