mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
fix(api): avoid memory leak with click functions in nvim_eval_statusline() (#21845)
Problem: Allocated click function memory is lost due to
`nvim_eval_statusline()` not passing in a `StlClickRecord`.
Solution: Do not allocate click function memory if `tabtab == NULL`.
Resolve #21764, supersede #21842.
This commit is contained in:
@@ -3211,6 +3211,17 @@ describe('API', function()
|
||||
'TextWithNoHighlight%#WarningMsg#TextWithWarningHighlight',
|
||||
{ use_winbar = true, highlights = true }))
|
||||
end)
|
||||
it('no memory leak with click functions', function()
|
||||
meths.eval_statusline('%@ClickFunc@StatusLineStringWithClickFunc%T', {})
|
||||
eq({
|
||||
str = 'StatusLineStringWithClickFunc',
|
||||
width = 29
|
||||
},
|
||||
meths.eval_statusline(
|
||||
'%@ClickFunc@StatusLineStringWithClickFunc%T',
|
||||
{})
|
||||
)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
describe('nvim_parse_cmd', function()
|
||||
|
||||
Reference in New Issue
Block a user