aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-09-28 10:21:06 +0800
committerGitHub <noreply@github.com>2024-09-28 10:21:06 +0800
commit4f9311b759fff0371433fb5b5355fccb001d54e7 (patch)
tree616920f079d5be9b7ac0c2e07fda93eb8913654c /test/functional/ui/float_spec.lua
parent0f067cd34d09b38f9aaf2e1732d825e89b573077 (diff)
downloadrneovim-4f9311b759fff0371433fb5b5355fccb001d54e7.tar.gz
rneovim-4f9311b759fff0371433fb5b5355fccb001d54e7.tar.bz2
rneovim-4f9311b759fff0371433fb5b5355fccb001d54e7.zip
fix(window): making float with title/footer non-float leaks memory (#30551)
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 52b46d0ecb..b2ed5f5a5f 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -2562,6 +2562,37 @@ describe('float window', function()
end
eq({{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, api.nvim_win_get_config(win).title)
eq({{"🦄", ""}, {"BB", {"B0", "B1", ""}}}, api.nvim_win_get_config(win).footer)
+
+ -- making it a split should not leak memory
+ api.nvim_win_set_config(win, { vertical = true })
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [4:--------------------]{5:│}[2:-------------------]|*5
+ {5:[No Name] [+] }{4:[No Name] }|
+ [3:----------------------------------------]|
+ ## grid 2
+ ^ |
+ {0:~ }|*4
+ ## grid 3
+ |
+ ## grid 4
+ halloj! |
+ BORDAA |
+ {0:~ }|*3
+ ]], win_viewport={
+ [2] = {win = 1000, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1, sum_scroll_delta = 0};
+ [4] = {win = 1001, topline = 0, botline = 3, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0};
+ }}
+ else
+ screen:expect{grid=[[
+ halloj! {5:│}^ |
+ BORDAA {5:│}{0:~ }|
+ {0:~ }{5:│}{0:~ }|*3
+ {5:[No Name] [+] }{4:[No Name] }|
+ |
+ ]]}
+ end
end)
it('terminates border on edge of viewport when window extends past viewport', function()