Skip to content

Commit

Permalink
fix(ui): changed return type in neovim nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
potamides committed Apr 1, 2024
1 parent 4617996 commit 9f5c6cd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lua/pantran/ui/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ function window:set_title(title)
local title_conf = {
border = "none",
zindex = conf.zindex + 1,
row = conf.row[false], -- FIXME: find out why this is a table
col = conf.col[false] + math.ceil((conf.width - title_len) / 2) + 1,
row = conf.row,
col = conf.col + math.ceil((conf.width - title_len) / 2) + 1,
width = title_len,
height = 1,
}
Expand Down Expand Up @@ -184,7 +184,11 @@ function window:set_config(conf)
end

function window:get_config()
return vim.api.nvim_win_get_config(self.win_id)
local conf = vim.api.nvim_win_get_config(self.win_id)
-- https://github.com/neovim/neovim/issues/27277
conf.row = type(conf.row) =="number" and conf.row or conf.row[false]
conf.col = type(conf.col) =="number" and conf.col or conf.col[false]
return conf
end

function window:set_option(option, value)
Expand Down

0 comments on commit 9f5c6cd

Please sign in to comment.