diff options
-rw-r--r-- | src/nvim/edit.c | 2 | ||||
-rw-r--r-- | src/nvim/getchar.c | 6 | ||||
-rw-r--r-- | src/nvim/screen.c | 23 | ||||
-rw-r--r-- | test/functional/eval/null_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/eval/timer_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/screen.lua | 4 |
7 files changed, 14 insertions, 29 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index fb06fc8859..4546aa4419 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -7803,7 +7803,7 @@ static bool ins_esc(long *count, int cmdchar, bool nomove) // Otherwise remove the mode message. if (reg_recording != 0 || restart_edit != NUL) { showmode(); - } else if (p_smd && !skip_showmode()) { + } else if (p_smd) { MSG(""); } // Exit Insert mode diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index eddbdef739..2e2993ed26 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -2490,10 +2490,8 @@ int inchar( } // Always flush the output characters when getting input characters - // from the user and not just peeking. - if (wait_time == -1L || wait_time > 10L) { - ui_flush(); - } + // from the user. + ui_flush(); // Fill up to a third of the buffer, because each character may be // tripled below. diff --git a/src/nvim/screen.c b/src/nvim/screen.c index dcf6657de2..a7fd2bfcc6 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -6559,21 +6559,6 @@ void grid_del_lines(ScreenGrid *grid, int row, int line_count, int end, int col, return; } -// Return true when postponing displaying the mode message: when not redrawing -// or inside a mapping. -bool skip_showmode(void) -{ - // Call char_avail() only when we are going to show something, because it - // takes a bit of time. redrawing() may also call char_avail_avail(). - if (global_busy - || msg_silent != 0 - || !redrawing() - || (char_avail() && !KeyTyped)) { - redraw_cmdline = true; // show mode later - return true; - } - return false; -} // Show the current mode and ruler. // @@ -6605,8 +6590,12 @@ int showmode(void) || restart_edit || VIsual_active)); if (do_mode || reg_recording != 0) { - if (skip_showmode()) { - return 0; // show mode later + // Don't show mode right now, when not redrawing or inside a mapping. + // Call char_avail() only when we are going to show something, because + // it takes a bit of time. + if (!redrawing() || (char_avail() && !KeyTyped) || msg_silent != 0) { + redraw_cmdline = TRUE; /* show mode later */ + return 0; } nwr_save = need_wait_return; diff --git a/test/functional/eval/null_spec.lua b/test/functional/eval/null_spec.lua index bef41e52d4..fa8f7d873f 100644 --- a/test/functional/eval/null_spec.lua +++ b/test/functional/eval/null_spec.lua @@ -121,7 +121,7 @@ describe('NULL', function() null_test('does not make Neovim crash when v:oldfiles gets assigned to that', ':let v:oldfiles = L|oldfiles', 0) null_expr_test('does not make complete() crash or error out', 'execute(":normal i\\<C-r>=complete(1, L)[-1]\\n")', - 0, '', function() + '', '\n', function() eq({''}, curbufmeths.get_lines(0, -1, false)) end) null_expr_test('is accepted by setmatches()', 'setmatches(L)', 0, 0) diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua index 3f57568b8e..9ee0735e40 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/eval/timer_spec.lua @@ -130,12 +130,12 @@ describe('timers', function() nvim_async("command", "call timer_start("..load_adjust(100)..", 'AddItem', {'repeat': -1})") screen:expect([[ - ^ITEM 1 | + ITEM 1 | ITEM 2 | {1:~ }| {1:~ }| {1:~ }| - | + ^ | ]]) nvim_async("command", "let g:cont = 1") diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 339ba0642c..8a5dd7ef18 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -391,7 +391,7 @@ describe('TUI', function() {1:x} | {4:~ }| {5:[No Name] [+] 3,1 All}| - :set ruler | + | {3:-- TERMINAL --} | ]] local expected_attr = { diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 5104c58796..8fa9fcc42f 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -807,9 +807,7 @@ function Screen:_handle_mouse_off() end function Screen:_handle_mode_change(mode, idx) - if self._mode_info ~= nil then - assert(mode == self._mode_info[idx+1].name) - end + assert(mode == self._mode_info[idx+1].name) self.mode = mode end |