From 1eb3bb568bd8edc830beb24697772667260eca18 Mon Sep 17 00:00:00 2001 From: Angus Date: Mon, 9 Oct 2023 11:21:01 +0800 Subject: [PATCH] Fix incorrect floating window position (#244) actually last PR(#243 )didn't solve the issue(#242 ) because the calculation should be done before make_floating_popup_options() --- lua/lsp_signature/helper.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/lsp_signature/helper.lua b/lua/lsp_signature/helper.lua index d8c7e36..9609fd5 100644 --- a/lua/lsp_signature/helper.lua +++ b/lua/lsp_signature/helper.lua @@ -399,14 +399,13 @@ helper.cal_pos = function(contents, opts) log(vim.inspect(contents)) local width, height = util._make_floating_popup_size(contents, opts) - local float_option = util.make_floating_popup_options(width, height, opts) - -- if the filetype returned is "markdown", and contents contains code fences, the height should minus 2, -- because the code fences won't be display local code_block_flag = contents[1]:match('^```') if filetype == 'markdown' and code_block_flag ~= nil then height = height - 2 end + local float_option = util.make_floating_popup_options(width, height, opts) log('popup size:', width, height, float_option) local off_y = 0