diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-18 17:55:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 17:55:03 +0800 |
commit | 36555730daaac8a9b88878a869c0cef6d5b701f0 (patch) | |
tree | b383b83f9b5dda2319ddeff206584fbbda8c79b2 /test/functional | |
parent | 0aae7f386042593aecfc8237020899d0e94fe8e4 (diff) | |
download | rneovim-36555730daaac8a9b88878a869c0cef6d5b701f0.tar.gz rneovim-36555730daaac8a9b88878a869c0cef6d5b701f0.tar.bz2 rneovim-36555730daaac8a9b88878a869c0cef6d5b701f0.zip |
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.
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/ui/statuscolumn_spec.lua | 16 |
1 files changed, 15 insertions, 1 deletions
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 | |