mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
screen: fix problem with p_ch
When the screen is resized, p_ch is not re-set to the appropriate value. As a result, access to invalid addresses was occurring.
This commit is contained in:
parent
a177820420
commit
581b2bcde0
@ -7507,6 +7507,10 @@ void screen_resize(int width, int height)
|
|||||||
Rows = height;
|
Rows = height;
|
||||||
Columns = width;
|
Columns = width;
|
||||||
check_shellsize();
|
check_shellsize();
|
||||||
|
int max_p_ch = Rows - min_rows() + 1;
|
||||||
|
if (!ui_has(kUIMessages) && p_ch > max_p_ch) {
|
||||||
|
p_ch = max_p_ch ? max_p_ch : 1;
|
||||||
|
}
|
||||||
height = Rows;
|
height = Rows;
|
||||||
width = Columns;
|
width = Columns;
|
||||||
p_lines = Rows;
|
p_lines = Rows;
|
||||||
|
@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen')
|
|||||||
local clear, feed = helpers.clear, helpers.feed
|
local clear, feed = helpers.clear, helpers.feed
|
||||||
local source = helpers.source
|
local source = helpers.source
|
||||||
local command = helpers.command
|
local command = helpers.command
|
||||||
|
local assert_alive = helpers.assert_alive
|
||||||
|
|
||||||
local function new_screen(opt)
|
local function new_screen(opt)
|
||||||
local screen = Screen.new(25, 5)
|
local screen = Screen.new(25, 5)
|
||||||
@ -842,3 +843,14 @@ describe('cmdline redraw', function()
|
|||||||
]], unchanged=true}
|
]], unchanged=true}
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
describe("cmdline height", function()
|
||||||
|
it("does not crash resized screen #14263", function()
|
||||||
|
clear()
|
||||||
|
local screen = Screen.new(25, 10)
|
||||||
|
screen:attach()
|
||||||
|
command('set cmdheight=9999')
|
||||||
|
screen:try_resize(25, 5)
|
||||||
|
assert_alive()
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user