fix(lsp): handle using array as open_floating_preview title (#33016)

This commit is contained in:
Au.
2025-03-22 10:43:06 +08:00
committed by GitHub
parent b165ad0671
commit 5187be81c2
3 changed files with 25 additions and 5 deletions

View File

@@ -3529,7 +3529,7 @@ describe('LSP', function()
)
end)
it('considers title when computing width', function()
it('considers string title when computing width', function()
eq(
{ 17, 2 },
exec_lua(function()
@@ -3542,6 +3542,20 @@ describe('LSP', function()
end)
)
end)
it('considers [string,string][] title when computing width', function()
eq(
{ 17, 2 },
exec_lua(function()
return {
vim.lsp.util._make_floating_popup_size(
{ 'foo', 'bar' },
{ title = { { 'A very ', 'Normal' }, { 'long title', 'Normal' } } }
),
}
end)
)
end)
end)
describe('lsp.util.trim.trim_empty_lines', function()