mirror of
https://github.com/neovim/neovim.git
synced 2025-12-12 17:42:37 +00:00
feat: has('terminfo')
Problem:
No way to detect at runtime if the build includes unibilium (or whatever
terminfo layer we swap it with later).
Solution:
Support `has('terminfo')`.
This commit is contained in:
@@ -64,6 +64,17 @@ describe('has()', function()
|
||||
end
|
||||
end)
|
||||
|
||||
it('"terminfo"', function()
|
||||
-- Looks like "HAVE_UNIBILIUM ", "HAVE_UNIBILIUM=1", "HAVE_UNIBILIUM off", ….
|
||||
-- Capture group returns the "1"/"off"/….
|
||||
local build_flag =
|
||||
vim.trim((n.exec_capture('verbose version'):match('HAVE_UNIBILIUM([^-]+)') or ''):lower())
|
||||
-- XXX: the match() above fails in CI so currently we assume CI always builds with unibilium.
|
||||
local is_enabled = t.is_ci()
|
||||
or not (build_flag == '' or build_flag == 'false' or build_flag == '0' or build_flag == 'off')
|
||||
eq(is_enabled and 1 or 0, fn.has('terminfo'))
|
||||
end)
|
||||
|
||||
it('"wsl"', function()
|
||||
local is_wsl = vim.uv.os_uname()['release']:lower():match('microsoft') and true or false
|
||||
if is_wsl then
|
||||
|
||||
Reference in New Issue
Block a user