fix(grid): assert crash during extreme resize layouts #36847

Problem:
When the terminal shrinks, Neovim tries to recompute the layout and
adjust every window so that the total width matches the new Columns. But
in the scenario of numerous windows split horizontally, there is
not enough space for all of them. The frame width (topframe->fr_width) never
reaches the new Columns value, the logic tries to redistribute this negative
space across child frames, but it triggers the assert.

Solution:
Skip this case in `win_update`.
This commit is contained in:
CompileAndConquer
2025-12-10 00:32:51 -05:00
committed by GitHub
parent c40cb2a4cf
commit aeebc51851
2 changed files with 21 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ local t = require('test.testutil')
local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
local set_session, clear = n.set_session, n.clear
local set_session, clear, assert_alive = n.set_session, n.clear, n.assert_alive
local feed, command = n.feed, n.command
local exec = n.exec
local insert = n.insert
@@ -646,6 +646,20 @@ local function screen_tests(linegrid)
]])
end)
it('does not crash when windows fill the screen #33883', function()
screen:try_resize(80, 20)
while true do
local ok = pcall(command, 'wincmd v')
if not ok then
break
end
end
screen:try_resize(60, 20)
assert_alive()
end)
it('clamps &cmdheight for current tabpage', function()
command('set cmdheight=10 laststatus=2')
screen:expect([[