From ac25d917632ddefcd5cf31fdb00ddc0a5291df44 Mon Sep 17 00:00:00 2001 From: nullchilly Date: Fri, 15 Jul 2022 22:17:09 +0700 Subject: [PATCH] refactor(setting): enable -> enabled for consistency --- README.md | 6 +++--- lua/catppuccin/config.lua | 4 ++-- lua/catppuccin/groups/editor.lua | 4 ++-- lua/catppuccin/groups/integrations/bufferline.lua | 4 ++-- lua/catppuccin/groups/integrations/gitsigns.lua | 4 ++-- lua/catppuccin/groups/integrations/ts_rainbow.lua | 4 ++-- lua/catppuccin/init.lua | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 35cfb86..6b47b08 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ dim_inactive = false, transparent_background = false, term_colors = false, compile = { - enable = false, + enabled = false, path = vim.fn.stdpath "cache" .. "/catppuccin", suffix = "_compiled" }, @@ -299,11 +299,11 @@ Catppuccin is a highly customizable and configurable colorscheme. This does howe Catppuccin can pre compute the results of your configuration and store the results in a compiled lua file. We use these precached values to set it's highlights. -- To enable compile enables it in setup function: +- Setting `enabled` to `true` enables this feature: ```lua compile = { - enable = true, + enabled = true, path = vim.fn.stdpath "cache" .. "/catppuccin", suffix = "_compiled" }, diff --git a/lua/catppuccin/config.lua b/lua/catppuccin/config.lua index 3d9ebae..df2f0aa 100644 --- a/lua/catppuccin/config.lua +++ b/lua/catppuccin/config.lua @@ -5,12 +5,12 @@ config.options = { transparent_background = false, term_colors = false, compile = { - enable = false, + enabled = false, path = vim.fn.stdpath("cache") .. "/catppuccin", suffix = "_compiled", }, dim_inactive = { - enable = false, + enabled = false, shade = "dark", percentage = 0.15, }, diff --git a/lua/catppuccin/groups/editor.lua b/lua/catppuccin/groups/editor.lua index 1498932..605450d 100644 --- a/lua/catppuccin/groups/editor.lua +++ b/lua/catppuccin/groups/editor.lua @@ -37,8 +37,8 @@ function M.get() Normal = { fg = cp.text, bg = cnf.transparent_background and cp.none or cp.base }, -- normal text NormalNC = { fg = cp.text, - bg = (cnf.transparent_background and cnf.dim_inactive.enable and lui.dim()) - or (cnf.dim_inactive.enable and cp.dim) + bg = (cnf.transparent_background and cnf.dim_inactive.enabled and lui.dim()) + or (cnf.dim_inactive.enabled and cp.dim) or (cnf.transparent_background and cp.none) or cp.base, }, -- normal text in non-current windows diff --git a/lua/catppuccin/groups/integrations/bufferline.lua b/lua/catppuccin/groups/integrations/bufferline.lua index 0cf36d0..1559876 100644 --- a/lua/catppuccin/groups/integrations/bufferline.lua +++ b/lua/catppuccin/groups/integrations/bufferline.lua @@ -3,9 +3,9 @@ local M = {} function M.get() local cnf = require("catppuccin.config").options local transparent_background = cnf.transparent_background - local bg_highlight = (transparent_background and cnf.dim_inactive.enable and cp.dim) + local bg_highlight = (transparent_background and cnf.dim_inactive.enabled and cp.dim) or (transparent_background and "NONE") - or (cnf.dim_inactive.enable and cp.dim) + or (cnf.dim_inactive.enabled and cp.dim) or cp.base local inactive_bg = transparent_background and "NONE" or cp.mantle diff --git a/lua/catppuccin/groups/integrations/gitsigns.lua b/lua/catppuccin/groups/integrations/gitsigns.lua index 845eecf..19a1ee1 100644 --- a/lua/catppuccin/groups/integrations/gitsigns.lua +++ b/lua/catppuccin/groups/integrations/gitsigns.lua @@ -2,9 +2,9 @@ local M = {} function M.get() local cnf = require("catppuccin.config").options - local bg_highlight = (cnf.transparent_background and cnf.dim_inactive.enable and cp.dim) + local bg_highlight = (cnf.transparent_background and cnf.dim_inactive.enabled and cp.dim) or (cnf.transparent_background and "NONE") - or (cnf.dim_inactive.enable and cp.dim) + or (cnf.dim_inactive.enabled and cp.dim) or cp.base return { GitSignsAdd = { fg = cp.green, bg = bg_highlight }, -- diff mode: Added line |diff.txt| diff --git a/lua/catppuccin/groups/integrations/ts_rainbow.lua b/lua/catppuccin/groups/integrations/ts_rainbow.lua index f6dea4a..8b5a705 100644 --- a/lua/catppuccin/groups/integrations/ts_rainbow.lua +++ b/lua/catppuccin/groups/integrations/ts_rainbow.lua @@ -3,9 +3,9 @@ local M = {} function M.get() local cnf = require("catppuccin.config").options local transparent_background = cnf.transparent_background - local bg_highlight = (transparent_background and cnf.dim_inactive.enable and cp.dim) + local bg_highlight = (transparent_background and cnf.dim_inactive.enabled and cp.dim) or (transparent_background and "NONE") - or (cnf.dim_inactive.enable and cp.dim) + or (cnf.dim_inactive.enabled and cp.dim) or cp.base return { rainbowcol1 = { bg = bg_highlight, fg = cp.red }, diff --git a/lua/catppuccin/init.lua b/lua/catppuccin/init.lua index d93ae98..6b2e58b 100644 --- a/lua/catppuccin/init.lua +++ b/lua/catppuccin/init.lua @@ -38,7 +38,7 @@ function M.load() local loaded = nil local config = require("catppuccin.config").options - if config.compile.enable == true then + if config.compile.enabled == true then local compiled_path = config.compile.path .. (vim.loop.os_uname().sysname == "Windows" and "\\" or "/") .. vim.g.catppuccin_flavour