Before this commit, FTerm always returned to the last window even though it might not be on the same tabpage. This commit fixes this behavior and switches only to the last window if its on the current tabpage.
Reproduce the issue:
Open nvim
Start a new terminal with lua require("FTerm").open()
Switch to another tabpage / open a new one
Close the terminal window with lua require("FTerm").close()
Before this commit, FTerm always returned to the last window even though it might not be on the same tabpage. This commit fixes this behavior and switches only to the last window if its on the current tabpage.
Reproduce the issue:
lua require("FTerm").open()
lua require("FTerm").close()
Thanks a lot for your work on this plugin! :)