This prevents nvim from throwing "Invalid window ID" error when fterm gets opened and the window which it was opened on (last_win) gets closed (e.g. nvim-tree).
To reproduce the bug, set view.float.enable to true in nvim-tree's config. Then open nvim-tree and open a terminal instance while nvim-tree is the current window. Now if you toggle the terminal, you'll get an error saying "Invalid window ID" because nvim-tree has already closed its own window due to another floating window being opened on top of it.
This prevents nvim from throwing "Invalid window ID" error when fterm gets opened and the window which it was opened on (last_win) gets closed (e.g. nvim-tree).
To reproduce the bug, set view.float.enable to
true
in nvim-tree's config. Then open nvim-tree and open a terminal instance while nvim-tree is the current window. Now if you toggle the terminal, you'll get an error saying "Invalid window ID" because nvim-tree has already closed its own window due to another floating window being opened on top of it.