fix: reset s:is_wsl after calling (un)install #1628
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The behaviors of
firenvim#install
andfirenvim#uninstall
on WSL are controlled by the script variables:is_wsl
: we initialize it to false to (un)install firenvim on wsl side, and then set it to 1 to (un)install on windows host side.Currently, only
firenvim#install
andfirenvim#uninstall
changes the value ofs:is_wsl
. The two function do not resets:is_wsl
, and thuss:is_wsl
is always 1 after calling them.As a result, doing the followings sequentially in neovim have unexpected results:
To fix this, a
try ... finally
block resetss:is_wsl
even if the two functions throw errors or run unsuccessfully.