From de670f380914e71d16b3357b609bdd3d0d30d95b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Oct 2021 17:34:45 +0800 Subject: fix(float): fix potential heap corruption in win_redr_border --- test/functional/ui/float_spec.lua | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 6c2c4b398a..64b0cbcbfb 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1194,6 +1194,50 @@ describe('float window', function() ]]} end + meths.win_set_config(win, {border={"", "_", "", "", "", "-", "", ""}}) + if multigrid then + command('redraw!') -- TODO: without a redraw this test fails, which should be fixed + screen:expect{grid=[[ + ## grid 1 + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [3:----------------------------------------]| + ## grid 2 + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + ## grid 3 + | + ## grid 5 + {5:_________}| + {1: halloj! }| + {1: BORDAA }| + {5:---------}| + ]], float_pos={ + [5] = { { id = 1002 }, "NW", 1, 2, 5, true } + }, win_viewport={ + [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1}; + [5] = {win = {id = 1002}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2}; + }} + else + screen:expect{grid=[[ + ^ | + {0:~ }| + {0:~ }{5:_________}{0: }| + {0:~ }{1: halloj! }{0: }| + {0:~ }{1: BORDAA }{0: }| + {0:~ }{5:---------}{0: }| + | + ]]} + end + insert [[ neeed some dummy background text -- cgit From 7ff1bc18a978d30f70db157be6f5fb2fb52b4215 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Oct 2021 19:22:00 +0800 Subject: fix(float): redraw if w_border_adj changed --- test/functional/ui/float_spec.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'test/functional/ui/float_spec.lua') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 64b0cbcbfb..b6d80616b4 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1196,7 +1196,6 @@ describe('float window', function() meths.win_set_config(win, {border={"", "_", "", "", "", "-", "", ""}}) if multigrid then - command('redraw!') -- TODO: without a redraw this test fails, which should be fixed screen:expect{grid=[[ ## grid 1 [2:----------------------------------------]| -- cgit