From 9f5c6cd99863752e65e887178258e98dccbae93d Mon Sep 17 00:00:00 2001 From: Jonas Belouadi Date: Mon, 1 Apr 2024 10:38:51 +0200 Subject: [PATCH] fix(ui): changed return type in neovim nightly --- lua/pantran/ui/window.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/pantran/ui/window.lua b/lua/pantran/ui/window.lua index 6f261b6..a5dfcda 100644 --- a/lua/pantran/ui/window.lua +++ b/lua/pantran/ui/window.lua @@ -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, } @@ -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)