Skip to content

Commit

Permalink
fix: remove unneeded changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Aug 30, 2022
1 parent de11bd6 commit 47a3682
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 50 deletions.
5 changes: 1 addition & 4 deletions src/nvim/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -3119,7 +3119,7 @@ void repeat_message(void)
/// Skip this when ":silent" was used, no need to clear for redirection.
void msg_clr_eos(void)
{
if (msg_silent == 0) {
if (msg_silent == 0 && p_ch > 0) {
msg_clr_eos_force();
}
}
Expand All @@ -3146,9 +3146,6 @@ void msg_clr_eos_force(void)
' ', ' ', HL_ATTR(HLF_MSG));
grid_fill(&msg_grid_adj, msg_row + 1, Rows, 0, Columns,
' ', ' ', HL_ATTR(HLF_MSG));
} else {
redraw_all_later(UPD_NOT_VALID);
clear_cmdline = true;
}

redraw_cmdline = true; // overwritten the command line
Expand Down
3 changes: 1 addition & 2 deletions src/nvim/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,7 @@ 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().
if (global_busy || msg_silent != 0 || !redrawing()
|| (char_avail() && !KeyTyped) || !ui_has_messages()) {
if (global_busy || msg_silent != 0 || !redrawing() || (char_avail() && !KeyTyped)) {
redraw_mode = true; // show mode later
return true;
}
Expand Down
44 changes: 0 additions & 44 deletions src/nvim/testdir/test_messages.vim
Original file line number Diff line number Diff line change
Expand Up @@ -435,48 +435,4 @@ func Test_cmdheight_zero()
tabonly
endfunc

func Test_cmdheight_showmode()
set cmdheight=0
set showmode

call feedkeys("i\<C-O>", 'ntx')
redraw

" The "-- (insert) --" indicator should not be visible.
let chars = map(range(1, &columns), 'nr2char(screenchar(&lines, v:val))')
let str = trim(join(chars, ''))
call assert_equal('~', str)

set showmode&
set cmdheight&
endfunc

func Test_cmdheight_zero_shell()
CheckUnix

set cmdheight=0
set nomore
call setline(1, 'foo!')
silent !echo <cWORD> > Xfile.out
call assert_equal(['foo!'], readfile('Xfile.out'))
call delete('Xfile.out')
redraw!

set more&
set cmdheight&
endfunc

func Test_cmdheight_zero_ctrl_c()
set cmdheight=0
call feedkeys("\<C-c>\<C-c>", 'ntx')
redraw

" The C-c messages should not be visible.
let chars = map(range(1, &columns), 'nr2char(screenchar(&lines, v:val))')
let str = trim(join(chars, ''))
call assert_equal('~', str)

set cmdheight&
endfunc

" vim: shiftwidth=2 sts=2 expandtab

0 comments on commit 47a3682

Please sign in to comment.