Fix native_entries_view.info width and col calculations (#1075)
The dictionary returned by `pum_getpos()` uses `scrollbar` not `scrollable` to indicate whether the scrollbar is visible or not. In addition, the padding on the left side of the popup menu isn't included in the output of `pum_getpos()`, meaning that both `col` and `width` (as understood by nvim-cmp) are off by one when the cursor isn't at column `0`. These two issues were causing the documentation window and popup menu to overlap.
This commit is contained in:
@@ -101,10 +101,10 @@ native_entries_view.info = function(self)
|
|||||||
if self:visible() then
|
if self:visible() then
|
||||||
local info = vim.fn.pum_getpos()
|
local info = vim.fn.pum_getpos()
|
||||||
return {
|
return {
|
||||||
width = info.width + (info.scrollable and 1 or 0),
|
width = info.width + (info.scrollbar and 1 or 0) + (info.col == 0 and 0 or 1),
|
||||||
height = info.height,
|
height = info.height,
|
||||||
row = info.row,
|
row = info.row,
|
||||||
col = info.col,
|
col = info.col == 0 and 0 or info.col - 1,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user