Skip to content

Commit

Permalink
Support new api (neovim breakingchange) (#96)
Browse files Browse the repository at this point in the history
new `nvim_win_get_config` returns row and col as numbers
  • Loading branch information
ttak0422 authored Mar 15, 2024
1 parent 969e95b commit 7a9d45d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lua/lir/float/curdir_window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,22 @@ function CurdirWindow.new(content_win_id, win_config)
border_line = 1
end

local win_config_row = context_win_config.row
if type(win_config_row) ~= "number" then
win_config_row = win_config_row[false]
end
local win_config_col = context_win_config.col
if type(win_config_col) ~= "number" then
win_config_col = win_config_col[false]
end

self.content_bufnr = vim.api.nvim_win_get_buf(content_win_id)
self.content_win_id = content_win_id
self.bufnr = api.nvim_create_buf(false, true)
self.win_id = api.nvim_open_win(self.bufnr, false, {
style = "minimal",
row = context_win_config.row[false] - 1 - border_line,
col = context_win_config.col[false],
row = win_config_row - 1 - border_line,
col = win_config_col,
width = context_win_config.width,
height = 1,
relative = "editor",
Expand Down

0 comments on commit 7a9d45d

Please sign in to comment.