fix no t_Co option error

This commit is contained in:
Ray Elliott 2024-05-20 12:02:25 +01:00
parent 8cdef01d65
commit 54641988db
1 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,9 @@
--[[/* VARS */]]
--- Which set of colors to use.
local _USE_256 = tonumber(vim.go.t_Co) > 255 or string.find(vim.env.TERM, '256')
local has_t_Co = pcall(function() return vim.go.t_Co end)
local _USE_256 = (has_t_Co and tonumber(vim.go.t_Co) > 255) or string.find(vim.env.TERM, '256')
--- Indicating nothing for a highlight field.
local _NONE = 'NONE'