From a9d7cbd722e0142fee69436fa3bbb6d18b8d3c27 Mon Sep 17 00:00:00 2001 From: acehinnnqru Date: Mon, 25 May 2026 06:00:53 +0800 Subject: [PATCH] fix(lsp): calc correct screen_width when opts.relative == 'editor' (#39977) --- runtime/lua/vim/lsp/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 085dd0f7f6..9f5b1cbcf6 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1367,7 +1367,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