From 383182516747153d6e3c9ff3a7e6a19262e42c93 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 12 Apr 2021 19:54:54 +0200 Subject: lsp: correct float placement when using borders Because borders add up to 2 to the height of a float, we need to subtract that from the anchor position, when opening a float in the lower half of the window. --- runtime/lua/vim/lsp/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index d0d379054d..325dc044be 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -890,7 +890,7 @@ function M.make_floating_popup_options(width, height, opts) else anchor = anchor..'S' height = math.min(lines_above, height) - row = 0 + row = -get_border_size(opts).height end if vim.fn.wincol() + width <= api.nvim_get_option('columns') then -- cgit