This PR fixes a regression introduced by e69c1b01b4cf0803cad5d7e49430af16760be55c, which wraps the closing by schedule_wrap. However, by wrapping it, pcall will never catch the error by nvim_win_close, causing a regression.
Adds a utility to safely close the window, since multiple places called nvim_win_close without handling the potential failure.
Fixes #1423.
One concern is the possibility that nvim_buf_delete in Buffer:hide could cause a similar error, but might be premature to add safety to this.
This PR fixes a regression introduced by e69c1b01b4cf0803cad5d7e49430af16760be55c, which wraps the closing by
schedule_wrap
. However, by wrapping it,pcall
will never catch the error bynvim_win_close
, causing a regression.Adds a utility to safely close the window, since multiple places called
nvim_win_close
without handling the potential failure.Fixes #1423.
One concern is the possibility that
nvim_buf_delete
inBuffer:hide
could cause a similar error, but might be premature to add safety to this.