mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
fix(cmdline): don't redraw 'tabline' in Ex mode (#24123)
Redrawing of 'statusline' and 'winbar' are actually already inhibited by RedawingDisabled in Ex mode. In Vim there is a check for `msg_scrolled == 0` (which is false in Ex mode) since Vim doesn't have msgsep. Add a `!exmode_active` check here in Nvim instead.
This commit is contained in:
parent
12c2c16acf
commit
3688735c2b
@ -791,7 +791,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent, bool clea
|
|||||||
|
|
||||||
// Redraw the statusline in case it uses the current mode using the mode()
|
// Redraw the statusline in case it uses the current mode using the mode()
|
||||||
// function.
|
// function.
|
||||||
if (!cmd_silent) {
|
if (!cmd_silent && !exmode_active) {
|
||||||
bool found_one = false;
|
bool found_one = false;
|
||||||
|
|
||||||
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
|
||||||
|
@ -944,6 +944,45 @@ describe('statusline is redrawn on entering cmdline', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('tabline is not redrawn in Ex mode #24122', function()
|
||||||
|
clear()
|
||||||
|
local screen = Screen.new(60, 5)
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
|
||||||
|
[1] = {bold = true, reverse = true}, -- MsgSeparator
|
||||||
|
[2] = {reverse = true}, -- TabLineFill
|
||||||
|
})
|
||||||
|
screen:attach()
|
||||||
|
|
||||||
|
exec([[
|
||||||
|
set showtabline=2
|
||||||
|
set tabline=%!MyTabLine()
|
||||||
|
|
||||||
|
function! MyTabLine()
|
||||||
|
|
||||||
|
return "foo"
|
||||||
|
endfunction
|
||||||
|
]])
|
||||||
|
|
||||||
|
feed('gQ')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{2:foo }|
|
||||||
|
|
|
||||||
|
{1: }|
|
||||||
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
|
:^ |
|
||||||
|
]]}
|
||||||
|
|
||||||
|
feed('echo 1<CR>')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1: }|
|
||||||
|
Entering Ex mode. Type "visual" to go to Normal mode. |
|
||||||
|
:echo 1 |
|
||||||
|
1 |
|
||||||
|
:^ |
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
|
|
||||||
describe("cmdline height", function()
|
describe("cmdline height", function()
|
||||||
it("does not crash resized screen #14263", function()
|
it("does not crash resized screen #14263", function()
|
||||||
clear()
|
clear()
|
||||||
|
Loading…
Reference in New Issue
Block a user