mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
fix(eval): fix has('wsl') #16153
Problem: has('wsl') is decided at build-time. Solution: Check os_uname(). Fixes #12642, #16143
This commit is contained in:
@@ -59,7 +59,12 @@ describe('has()', function()
|
||||
end)
|
||||
|
||||
it('"wsl"', function()
|
||||
if 1 == funcs.has('win32') or 1 == funcs.has('mac') then
|
||||
local luv = require('luv')
|
||||
local is_wsl =
|
||||
luv.os_uname()['release']:lower():match('microsoft') and true or false
|
||||
if is_wsl then
|
||||
eq(1, funcs.has('wsl'))
|
||||
else
|
||||
eq(0, funcs.has('wsl'))
|
||||
end
|
||||
end)
|
||||
|
Reference in New Issue
Block a user