fix(statusline): don't leak memory with zero-width click labels

A zero-width click label isn't assigned to any click definition, so its
function name should be freed when filling click definitions.
This commit is contained in:
zeertzjq
2023-01-18 15:12:45 +08:00
parent 45dc0f3454
commit 295a264b65
2 changed files with 22 additions and 4 deletions

View File

@@ -164,6 +164,16 @@ describe('statusline clicks', function()
meths.input_mouse('right', 'press', '', 0, 6, 5)
eq('0 1 r', eval("g:testvar"))
end)
it('no memory leak with zero-width click labels', function()
command([[
let &stl = '%@Test@%T%@MyClickFunc@%=%T%@Test@'
]])
meths.input_mouse('left', 'press', '', 0, 6, 0)
eq('0 1 l', eval("g:testvar"))
meths.input_mouse('right', 'press', '', 0, 6, 39)
eq('0 1 r', eval("g:testvar"))
end)
end)
describe('global statusline', function()