Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add has('wsl') to help set s:is_wsl #1582

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

xudyang1
Copy link
Contributor

vim.fn.has() or has() can help check current runtime condition.

As :h has() indicates:

Returns 1 if {feature} is supported, 0 otherwise.
...
2. Runtime condition or other pseudo-feature. For example the
"win32" feature checks if the current system is Windows:
:if has("win32")
feature-list
List of supported pseudo-feature names:
... ......
wsl WSL (Windows Subsystem for Linux) system.

Inspired from:

https://github.com/neovim/neovim/blob/dc466f9a63ede5e2bbddc33688c0c972abfe9a52/runtime/autoload/provider/clipboard.vim#L132

`vim.fn.has()` or `has()` can help check current runtime condition.

As `:h has()` indicates:

> Returns 1 if {feature} is supported, 0 otherwise.
> ...
> 2. Runtime condition or other pseudo-feature. For example the
>     "win32" feature checks if the current system is Windows:
>         :if has("win32")
>         				*feature-list*
>     List of supported pseudo-feature names:
>         ...             ......
>         wsl		WSL (Windows Subsystem for Linux) system.

Inspired from:

https://github.com/neovim/neovim/blob/dc466f9a63ede5e2bbddc33688c0c972abfe9a52/runtime/autoload/provider/clipboard.vim#L132
@glacambre
Copy link
Owner

Thank you! :)

@glacambre glacambre merged commit f2dd6d3 into glacambre:master Jan 23, 2024
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants