savq / melange-nvim

🗡️ Warm color scheme for Neovim and beyond
MIT License
719 stars 55 forks source link

Fine-tune font variant options #77

Closed arwenestalia closed 8 months ago

arwenestalia commented 9 months ago

Everything defaults to true for backwards compatibility

vim.g.melange_enable_font_variants = false disables all vim.g.melangeenable{option} = false disables individual option

savq commented 9 months ago

Hi @arwenestalia, thanks for the PR.

I think allowing melange_enable_font_variants to be a table would also work here. If it's a boolean then it'd work the same as always. If it's a table then set the values of the table (without defaulting to true, since it's simpler to let the nils pass thru). This way we don't have to introduce more global variables.

I haven't documented melange_enable_font_variants because I'm not a big fan of adding lots of config options, but I think this would be a reasonable compromise.

arwenestalia commented 9 months ago

@savq I've integrated your suggestions. There's probably a more clever way to implement the desired behavior, but this way might be the least ambiguous.

Example configurations:

vim.g.melange_enable_font_variants = true -- same as nil (default)
vim.g.melange_enable_font_variants = false -- disable all font variants
vim.g.melange_enable_font_variants = { -- enable a subset of font variants, nil is passed
    bold = true,
    undercurl = true,
    underline = true,
}
savq commented 8 months ago

LGTM 👍