mirror of
https://github.com/neovim/neovim.git
synced 2025-11-11 13:05:37 +00:00
fix(lsp): show title when global winborder is set (#35181)
Problem: make_floating_popup_options only shows when opts.border is explicitly set, ignoring global winborder setting Solution: check both opts.border and vim.o.winborder when determining whether to show title
This commit is contained in:
@@ -942,7 +942,7 @@ function M.make_floating_popup_options(width, height, opts)
|
|||||||
col = 1
|
col = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
local title = (opts.border and opts.title) and opts.title or nil
|
local title = ((opts.border or vim.o.winborder ~= '') and opts.title) and opts.title or nil
|
||||||
local title_pos --- @type 'left'|'center'|'right'?
|
local title_pos --- @type 'left'|'center'|'right'?
|
||||||
|
|
||||||
if title then
|
if title then
|
||||||
|
|||||||
@@ -267,6 +267,14 @@ describe('vim.lsp.util', function()
|
|||||||
|
|
||||||
eq(56, opts.height)
|
eq(56, opts.height)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('title with winborder option #35179', function()
|
||||||
|
local opts = exec_lua(function()
|
||||||
|
vim.o.winborder = 'single'
|
||||||
|
return vim.lsp.util.make_floating_popup_options(100, 100, { title = 'Title' })
|
||||||
|
end)
|
||||||
|
eq('Title', opts.title)
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user