Skip to content

Commit

Permalink
Fix incorrect floating window position (#244)
Browse files Browse the repository at this point in the history
actually last PR(#243 )didn't solve the issue(#242 ) because the calculation should be done before make_floating_popup_options()
  • Loading branch information
kulakilam authored Oct 9, 2023
1 parent cc29090 commit 1eb3bb5
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 1eb3bb5

Please sign in to comment.