From fc55f8263c6c8d8851fa2b6290083a64da1ebd28 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Jul 2022 06:26:01 +0800 Subject: vim-patch:9.0.0086: tabline is not redrawn when entering command line Problem: Tabline is not redrawn when entering command line. Solution: Set "redraw_tabline". (closes vim/vim#10771) https://github.com/vim/vim/commit/6791adca53981666f0cf23e264e102b795224044 --- src/nvim/ex_getln.c | 6 ++++++ src/nvim/testdir/test_cmdline.vim | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'src') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 04334d4fa0..906e52f183 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -880,6 +880,12 @@ static uint8_t *command_line_enter(int firstc, long count, int indent, bool init found_one = true; } } + + if (*p_tal != NUL) { + redraw_tabline = true; + found_one = true; + } + if (found_one) { redraw_statuslines(); } diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 276bb7fb71..a0907d79ac 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -1846,4 +1846,20 @@ func Test_long_error_message() silent! norm Q00000000000000     000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000                                                                                                                                                                                                                         endfunc +func Test_cmdline_redraw_tabline() + CheckRunVimInTerminal + + let lines =<< trim END + set showtabline=2 + autocmd CmdlineEnter * set tabline=foo + END + call writefile(lines, 'Xcmdline_redraw_tabline') + let buf = RunVimInTerminal('-S Xcmdline_redraw_tabline', #{rows: 6}) + call term_sendkeys(buf, ':') + call WaitForAssert({-> assert_match('^foo', term_getline(buf, 1))}) + + call StopVimInTerminal(buf) + call delete('Xcmdline_redraw_tabline') +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit