fix(window): clear cmdline 'ruler' when window is closed (#38631)

Problem:  When 'ruler' is in last line of the screen and the current
          floating window is closed, the ruler is not cleared.
Solution: When closing the current floating window, redraw the cmdline
          if that contained, and will no longer contain the 'ruler'.
(cherry picked from commit cd2a27507a)
This commit is contained in:
luukvbaal
2026-03-31 18:02:26 +02:00
committed by GitHub
parent f7b4eb5e0b
commit 32ca1aae88
2 changed files with 16 additions and 0 deletions

View File

@@ -805,6 +805,19 @@ describe('statusline', function()
]])
end)
it('ruler is cleared when window without statusline is closed', function()
local cfg = { relative = 'editor', row = 1, col = 1, height = 1, width = 1 }
local win = api.nvim_open_win(0, true, cfg)
command('set ruler laststatus=2')
api.nvim_win_close(win, true)
screen:expect([[
^ |
{1:~ }|*5
{3:[No Name] 0,0-1 All}|
|
]])
end)
it('hidden moves ruler to cmdline', function()
-- Use long ruler to check 'ruler' with 'rulerformat' set has correct width.
command [[