fix(lsp): calc correct screen_width when opts.relative == 'editor' (#39977)

(cherry picked from commit a9d7cbd722)
This commit is contained in:
acehinnnqru
2026-05-25 06:00:53 +08:00
committed by github-actions[bot]
parent d1cf3ab4c3
commit 445fe8a6b7

View File

@@ -1544,7 +1544,7 @@ function M._make_floating_popup_size(contents, opts)
end
local _, border_width = get_border_size(opts)
local screen_width = api.nvim_win_get_width(0)
local screen_width = opts.relative == 'editor' and vim.o.columns or api.nvim_win_get_width(0)
width = math.min(width, screen_width)
-- make sure borders are always inside the screen