Skip to content

Commit

Permalink
Fix incorrect floating window position
Browse files Browse the repository at this point in the history
actually last PR(ray-x#243 )didn't solve the issue(ray-x#242 ) because the calculation should be done before make_floating_popup_options()
  • Loading branch information
kulakilam authored Nov 30, 2022
1 parent 2f3e574 commit 7d6014d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lua/lsp_signature/helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d6014d

Please sign in to comment.