Skip to content

Commit

Permalink
fix: handle breaking change to vim.api.nvim_win_get_config (nvimdev#1397
Browse files Browse the repository at this point in the history
)
  • Loading branch information
scratchyone committed Feb 24, 2024
1 parent b1b140a commit 35aa352
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/lspsaga/codeaction/preview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,18 @@ local preview_buf, preview_winid
---default is under the given window
local function create_preview_win(content, main_winid)
local win_conf = api.nvim_win_get_config(main_winid)

-- In versions of NVIM before v0.10.0 `api.nvim_win_get_config` will return a table
-- see https://github.com/neovim/neovim/issues/24430
if (type(win_conf.col) == "table") then
win_conf.col = win_conf.col[false]
end

local max_height
local opt = {
relative = win_conf.relative,
win = win_conf.win,
col = win_conf.col[false],
col = win_conf.col,
anchor = win_conf.anchor,
focusable = false,
}
Expand Down

0 comments on commit 35aa352

Please sign in to comment.