diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-31 15:38:45 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-12-31 16:44:53 -0500 |
commit | 723e009214ab321ad75051d3c36e3379b1c5e5a8 (patch) | |
tree | 10e57056695804f3479176d28fc62f77b56bf20f /src/nvim/message.c | |
parent | 74b343a6f23de43590ab79750848f66e2fa9a7f7 (diff) | |
download | rneovim-723e009214ab321ad75051d3c36e3379b1c5e5a8.tar.gz rneovim-723e009214ab321ad75051d3c36e3379b1c5e5a8.tar.bz2 rneovim-723e009214ab321ad75051d3c36e3379b1c5e5a8.zip |
Revert "vim-patch:8.1.1192: mode is not cleared when leaving Insert mode with mapped Esc"
This reverts commit 44bb7147e40743d9a70ee3a2663a7a7dacec7b13.
Avoid regression mentioned in https://github.com/neovim/neovim/commit/c64cce906e7ed828d331e1786c985ff7aa734546#commitcomment-45554271
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r-- | src/nvim/message.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index 530b930fed..02a7732f5c 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1128,11 +1128,11 @@ void wait_return(int redraw) if (p_more) { if (c == 'b' || c == 'k' || c == 'u' || c == 'g' || c == K_UP || c == K_PAGEUP) { - if (msg_scrolled > Rows) { - // scroll back to show older messages + if (msg_scrolled > Rows) + /* scroll back to show older messages */ do_more_prompt(c); - } else { - msg_didout = false; + else { + msg_didout = FALSE; c = K_IGNORE; msg_col = cmdmsg_rl ? Columns - 1 : @@ -2097,17 +2097,15 @@ static void msg_puts_display(const char_u *str, int maxlen, int attr, store_sb_text((char_u **)&sb_str, (char_u *)s, attr, &sb_col, true); } - if (*s == '\n') { // go to next line - msg_didout = false; // remember that line is empty - if (cmdmsg_rl) { + if (*s == '\n') { /* go to next line */ + msg_didout = FALSE; /* remember that line is empty */ + if (cmdmsg_rl) msg_col = Columns - 1; - } else { + else msg_col = 0; - } - if (++msg_row >= Rows) { // safety check + if (++msg_row >= Rows) /* safety check */ msg_row = Rows - 1; - } - } else if (*s == '\r') { // go to column 0 + } else if (*s == '\r') { /* go to column 0 */ msg_col = 0; } else if (*s == '\b') { /* go to previous char */ if (msg_col) @@ -2880,10 +2878,10 @@ void repeat_message(void) ui_cursor_goto(msg_row, msg_col); /* put cursor back */ } else if (State == HITRETURN || State == SETWSIZE) { if (msg_row == Rows - 1) { - // Avoid drawing the "hit-enter" prompt below the previous one, - // overwrite it. Esp. useful when regaining focus and a - // FocusGained autocmd exists but didn't draw anything. - msg_didout = false; + /* Avoid drawing the "hit-enter" prompt below the previous one, + * overwrite it. Esp. useful when regaining focus and a + * FocusGained autocmd exists but didn't draw anything. */ + msg_didout = FALSE; msg_col = 0; msg_clr_eos(); } |