From 4b68b8dd2aa5bb74fe8cd058797322d81df1f455 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Tue, 4 Jan 2022 02:22:52 +0100 Subject: [PATCH] fix: use nvim-api to avoid win_getid exceptions (#525) --- lua/lualine/utils/notices.lua | 2 +- lua/lualine/utils/utils.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lualine/utils/notices.lua b/lua/lualine/utils/notices.lua index 9b1e5b1..a02309f 100644 --- a/lua/lualine/utils/notices.lua +++ b/lua/lualine/utils/notices.lua @@ -45,7 +45,7 @@ end function M.show_notices() vim.cmd('silent! keepalt split') - local winid = vim.fn.win_getid() + local winid = vim.api.nvim_get_current_win() local bufnr = vim.api.nvim_create_buf(false, true) vim.api.nvim_win_set_buf(winid, bufnr) diff --git a/lua/lualine/utils/utils.lua b/lua/lualine/utils/utils.lua index d2a7eca..eeea03d 100644 --- a/lua/lualine/utils/utils.lua +++ b/lua/lualine/utils/utils.lua @@ -90,7 +90,7 @@ end -- Check if statusline is on focused window or not function M.is_focused() - return tonumber(vim.g.actual_curwin) == vim.fn.win_getid() + return tonumber(vim.g.actual_curwin) == vim.api.nvim_get_current_win() end --- Check what's the charecter at pos