From 36555730daaac8a9b88878a869c0cef6d5b701f0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 18 Jan 2023 17:55:03 +0800 Subject: fix(statuscolumn): always fill click defs array (#21878) Click definitions are always filled for tabline, statusline and winbar, so they should also be always filled for statuscolumn, otherwise it will leak memory. Note: this doesn't actually change the existing code much, because of a typo in the existing code. --- test/functional/ui/statuscolumn_spec.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test/functional') diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua index 32ed856872..3da630ddcc 100644 --- a/test/functional/ui/statuscolumn_spec.lua +++ b/test/functional/ui/statuscolumn_spec.lua @@ -5,6 +5,7 @@ local command = helpers.command local eq = helpers.eq local eval = helpers.eval local exec_lua = helpers.exec_lua +local feed = helpers.feed local meths = helpers.meths local pcall_err = helpers.pcall_err @@ -413,6 +414,19 @@ describe('statuscolumn', function() eq('', eval("g:testvar")) end) + it('click labels do not leak memory', function() + command([[ + set laststatus=2 + setlocal statuscolumn=%0@MyClickFunc@abcd%T + 4vsplit + setlocal statusline=abcd + redrawstatus + setlocal statusline= + only + redraw + ]]) + end) + it('works with foldcolumn', function() -- Fits maximum multibyte foldcolumn #21759 command([[set stc=%C%=%l\ fdc=9 fillchars=foldsep:ð’€€]]) @@ -425,7 +439,7 @@ describe('statuscolumn', function() vim.api.nvim_buf_set_extmark(0, ns, 7, 0, { virt_lines_leftcol = true, virt_lines = {{{"virt", ""}}} }) ]]) - helpers.feed('lh') -- force update wcol/row + feed('lh') -- force update wcol/row screen:expect([[ 4 aaaaa | 5 aaaaa | -- cgit