fix potential execution bug when nvim_win_close raises exception
This commit is contained in:
parent
6d65097d45
commit
c815531334
@ -793,7 +793,10 @@ function FzfWin:close()
|
||||
self.closing = true
|
||||
self:close_preview()
|
||||
if self.fzf_winid and vim.api.nvim_win_is_valid(self.fzf_winid) then
|
||||
vim.api.nvim_win_close(self.fzf_winid, {force=true})
|
||||
-- run in a pcall due to potential errors while closing the window
|
||||
-- Vim(lua):E5108: Error executing lua
|
||||
-- experienced while accessing 'vim.b[]' from my statusline code
|
||||
pcall(vim.api.nvim_win_close, self.fzf_winid, {force=true})
|
||||
end
|
||||
if self.fzf_bufnr and vim.api.nvim_buf_is_valid(self.fzf_bufnr) then
|
||||
vim.api.nvim_buf_delete(self.fzf_bufnr, {force=true})
|
||||
|
Loading…
Reference in New Issue
Block a user