this repo has no description

Add missing "character" color and make accessing non-existent colors noticable.

+16 -1
+16 -1
lua/wombat_lua/colors.lua
··· 1 1 -- stylua: ignore 2 - local M = { 2 + local _colors = { 3 3 -- Syntax elements 4 4 constant = "#e5786d", 5 5 namespace = "#e5786d", ··· 11 11 special = "#eadead", 12 12 string = "#95e454", 13 13 docstring = "#95e454", 14 + character = "#d787ff", 14 15 escape = "#d787ff", 15 16 attribute = "#e5786d", 16 17 ··· 66 67 unknown = "#ff2026", 67 68 } 68 69 70 + -- Make M.non_existent cause an error 71 + local M = {} 72 + setmetatable(M, { 73 + __index = function(_, key) 74 + if _colors[key] then 75 + return _colors[key] 76 + elseif key == "none" then 77 + return nil 78 + else 79 + print("wombat: Color '" .. key .. "' is not defined") 80 + return nil 81 + end 82 + end, 83 + }) 69 84 return M