This commit is contained in:
Justin M. Keyes
2026-04-29 17:37:47 -04:00
committed by GitHub
parent 040bdf0bc5
commit 1e06e95662
19 changed files with 257 additions and 100 deletions

View File

@@ -923,8 +923,8 @@ function M.make_floating_popup_options(width, height, opts)
local anchor = ''
local lines_above --- @type integer
local lines_below --- @type integer
local lines_above = vim.fn.winline() - 1
local lines_below = vim.fn.winheight(0) - lines_above
if opts.relative == 'mouse' then
lines_above = vim.fn.getmousepos().line - 1
lines_below = vim.fn.winheight(0) - lines_above
@@ -932,9 +932,6 @@ function M.make_floating_popup_options(width, height, opts)
-- No cursor to anchor against; treat the whole editor as space below.
lines_above = 0
lines_below = vim.o.lines
else
lines_above = vim.fn.winline() - 1
lines_below = vim.fn.winheight(0) - lines_above
end
local anchor_bias = opts.anchor_bias or 'auto'
@@ -962,13 +959,11 @@ function M.make_floating_popup_options(width, height, opts)
row = 0
end
local wincol --- @type integer
local wincol = vim.fn.wincol()
if opts.relative == 'mouse' then
wincol = vim.fn.getmousepos().column
elseif opts.relative == 'editor' then
wincol = 0
else
wincol = vim.fn.wincol()
end
if wincol + width + (opts.offset_x or 0) <= vim.o.columns then