From 2951af7bbd839ebef25e33f8bd01bd5c501f76c8 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Sat, 29 Oct 2022 18:19:38 +0200 Subject: Update how options and colorscheme is set (#12) * Update loading of colorscheme * Fix typo * Fix setting of style * Fix highlighting * Unpack style * Add empty table if props are nil * Fix concat of tables * Fix typo * Update settings * Add call set in settings * Add deep extend * Remove style field * Update README BREAKING CHANGE: updates how the colorscheme is set and the structure of the options table --- lua/no-clown-fiesta/settings.lua | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'lua/no-clown-fiesta/settings.lua') diff --git a/lua/no-clown-fiesta/settings.lua b/lua/no-clown-fiesta/settings.lua index e41380c..78f78ad 100644 --- a/lua/no-clown-fiesta/settings.lua +++ b/lua/no-clown-fiesta/settings.lua @@ -1,17 +1,22 @@ local M = {} -local palette = require "no-clown-fiesta.palette" -local default = { - transparent_background = palette.bg, - comments = "NONE", - keywords = "NONE", - functions = "NONE", - variables = "NONE", - type = "NONE", +local DEFAULT = { + transparent = false, + styles = { + comments = {}, + keywords = {}, + functions = {}, + variables = {}, + type = { bold = true }, + }, } -function M.set(opts) - return vim.tbl_extend("force", default, opts) +M.options = {} + +function M.set(options) + M.options = vim.tbl_deep_extend("force", DEFAULT, options or {}) end +M.set() + return M -- cgit v1.2.3-70-g09d2