Problem: Since `foldclose` is async, it must wait for the request to return before actually executing, at which point the original window may no longer be valid. Solution: Check whether the window is valid before actually performing `foldclose`.
io.neovim.nvim
org.neovim.nvim