diff --git a/lua/paper-tonic.lua b/lua/paper-tonic.lua index 9bdeda3..c6f39f3 100644 --- a/lua/paper-tonic.lua +++ b/lua/paper-tonic.lua @@ -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'