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

Commit a10959f

Browse files
committed
fix: check if hover width is a valid number(#53)
1 parent 4b5a547 commit a10959f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lua/completion/hover.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ local fancy_floating_markdown = function(contents, opts)
217217
width = api.nvim_get_option('columns'),
218218
})
219219
else
220-
winnr = api.nvim_open_win(bufnr, false, make_floating_popup_options(width, height, opts))
220+
local opt = make_floating_popup_options(width, height, opts)
221+
if opt.width < 0 then return end
222+
winnr = api.nvim_open_win(bufnr, false, opt)
221223
end
222224
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, stripped)
223225

0 commit comments

Comments
 (0)