Skip to content

Commit

Permalink
use pcall to handle error
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Mar 3, 2022
1 parent e31d615 commit 98a820e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/csvtools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ end

function M.CloseWindow()
if Status.winid ~= nil then
vim.api.nvim_win_close(Status.winid, true)
-- top window may close by people, so use pcall
pcall(vim.api.nvim_win_close, Status.winid, true)
Status.winid = nil
Status.buf = nil
Status.header = {}
Expand Down

0 comments on commit 98a820e

Please sign in to comment.