Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 936bbd1

Browse files
authored
Merge pull request #280 from lukas-reineke/bugfix/floating-window-with-pum-scrollbar
move floating window when pum has a scrollbar
2 parents d5685ec + 2ad923c commit 936bbd1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/completion/hover.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,18 @@ local function handler_function(_, method, result)
272272
-- Set max width option to avoid overlapping with popup menu
273273
local total_column = api.nvim_get_option('columns')
274274
local align
275+
local col = position['col']
275276
if position['col'] < total_column/2 then
276277
align = 'right'
278+
if position['scrollbar'] then
279+
col = col + 1
280+
end
277281
else
278282
align = 'left'
279283
end
280284
bufnr, winnr = fancy_floating_markdown(markdown_lines, {
281285
pad_left = 0; pad_right = 1;
282-
col = position['col']; width = position['width']; row = position['row']-1;
286+
col = col; width = position['width']; row = position['row']-1;
283287
align = align
284288
})
285289
M.winnr = winnr

0 commit comments

Comments
 (0)