Open EdenEast opened 1 year ago
I am not sure I like the hl.
spec.
prefixes
hl = {
TelescopeBorder = { fg = spec.bg4 }
TelescopeTitle = { fg = spec.fg2, bg = spec.bg4 }
CmpItemKindFunction = { fg = p.magenta.base }
CmpItemKindMethod = { fg = p.magenta.base }
CmpWindowBorder = { fg = spec.bg0, bg = spec.bg0 }
}
Seems better to me as an user
The idea would be that the function would be passed the actual lua tables that nightfox uses. You can then do what you want and reference what you want with that lua table.
One of the issues with that is that users can override the entire highlight group table for example. Since this is also just a lua function the user can just deep extend a local table that they create.
on_highlight = function(spec, hl, name, color)
local p = spec.palette
local override = {
TelescopeBorder = { fg = spec.bg4 },
TelescopeTitle = { fg = spec.fg2, bg = spec.bg4 },
CmpItemKindFunction = { fg = p.magenta.base },
CmpItemKindMethod = { fg = p.magenta.base },
CmpWindowBorder = { fg = spec.bg0, bg = spec.bg0 },
}
vim.tbl_deep_extend("force", hl, override)
end
Maybe instead of modding the actual table the function would expect to return a table that would would then be extended in nightfox.
Keep in mind that there isn't a vim.tbl_deep_extend
inside vim's lua
As a result I added this https://github.com/catppuccin/nvim/blob/main/lua/catppuccin/lib/vim/init.lua
Maybe instead of modding the actual table the function would expect to return a table that would would then be extended in nightfox.
Yes, that's what I do in catppuccin
Now that pr #241 has landed I would like to change now nightfox is configured. Instead of having a lua table that you fill in and extend with nightfox I would like to expose this as a lua function instead. Here is a mock up of what a config would look like.
In the example above,
name
would be the name of the style, andcolor
would be nightfox's Color manipulation library.User's configuration is now hashed and cached these functions would only be executed when there is a change to nightfox or the file that the nightfox setup function is called.