From 1fa6dae64bd26a88fc3d9750cc7c01126890c574 Mon Sep 17 00:00:00 2001 From: A-Lamia Date: Tue, 31 Dec 2024 16:31:34 +1100 Subject: [PATCH 1/3] refactor(telescope): rework config styling logic --- lua/astrotheme/groups/plugins/telescope.lua | 68 +++++++-------------- 1 file changed, 22 insertions(+), 46 deletions(-) diff --git a/lua/astrotheme/groups/plugins/telescope.lua b/lua/astrotheme/groups/plugins/telescope.lua index e5423b4..bfea580 100644 --- a/lua/astrotheme/groups/plugins/telescope.lua +++ b/lua/astrotheme/groups/plugins/telescope.lua @@ -1,33 +1,12 @@ ---@type AstroThemeCallback local function callback(c, opts) - local title = { - fg = (opts.title_invert and c.ui.float) or c.ui.title, - bg = (opts.title_invert and c.ui.title) - or (opts.inactive and c.ui.base) - or (opts.transparent and opts.float and c.ui.base) - or (opts.float and c.ui.float) - or (opts.transparent and c.none) - or c.ui.base, - bold = true, - } - - local normal = { - fg = c.ui.text, - bg = (opts.inactive and c.ui.base) - or (opts.transparent and opts.float and c.ui.base) - or (opts.float and c.ui.float) - or (opts.transparent and c.none) - or c.ui.base, - } - - local border = { - fg = (opts.border and c.ui.border) or (opts.inactive and c.ui.base) or (opts.float and c.ui.float) or c.ui.base, - bg = (opts.border and opts.inactive and c.ui.base) - or (opts.transparent and opts.float and c.ui.base) - or (opts.float and c.ui.float) - or (opts.transparent and c.none) - or c.ui.base, - } + local prompt_bg = (opts.border and opts.float and opts.inactive and c.ui.float) + or (opts.border and opts.float and opts.transparent and c.ui.base) + or (opts.border and opts.float and c.ui.float) + or (opts.border and opts.inactive and c.ui.base) + or (opts.border and opts.transparent and c.none) + or (opts.border and c.ui.base) + or c.ui.prompt return { ---------------- @@ -36,14 +15,11 @@ local function callback(c, opts) TelescopePromptTitle = { fg = (opts.title_invert and c.ui.float) or c.ui.title, - bg = (opts.title_invert and c.ui.title) - or (opts.float and c.ui.prompt) - or (opts.transparent and c.none) - or c.ui.base, + bg = (opts.title_invert and c.ui.title) or prompt_bg, bold = true, }, - TelescopeResultsTitle = title, - TelescopePreviewTitle = title, + TelescopeResultsTitle = { link = "FloatTitle" }, + TelescopePreviewTitle = { link = "FloatTitle" }, -- TelescopeTitle = "FloatTitle", -- TelescopePromptTitle = "TelescopeTitle", @@ -56,15 +32,10 @@ local function callback(c, opts) TelescopePromptNormal = { fg = c.ui.text, - bg = (opts.border and opts.inactive and c.ui.base) - or (opts.border and opts.float and c.ui.base) - or (opts.inactive and c.ui.prompt) - or (opts.float and c.ui.prompt) - or (opts.transparent and c.none) - or c.ui.base, + bg = prompt_bg, }, - TelescopeResultsNormal = normal, - TelescopePreviewNormal = normal, + TelescopeResultsNormal = { link = "NormalFloat" }, + TelescopePreviewNormal = { link = "NormalFloat" }, -- TelescopeNormal = "NormalFloat", -- TelescopePromptNormal = "TelescopeNormal", @@ -76,11 +47,16 @@ local function callback(c, opts) ---------------- TelescopePromptBorder = { - fg = (opts.border and c.ui.border) or (opts.inactive and c.ui.base) or (opts.float and c.ui.prompt) or c.ui.base, - bg = (opts.border and opts.inactive and c.ui.base) or (opts.float and c.ui.prompt) or c.ui.prompt, + fg = (opts.border and opts.float and c.ui.border) + or (opts.border and opts.inactive and c.ui.border) + or (opts.border and opts.transparent and c.ui.base) + or (opts.border and c.ui.border) + or c.ui.prompt, + bg = prompt_bg, }, - TelescopeResultsBorder = border, - TelescopePreviewBorder = border, + -- TelescopePromptBorder = border, + TelescopeResultsBorder = { link = "FloatBorder" }, + TelescopePreviewBorder = { link = "FloatBorder" }, -- TelescopeBorder = "FloatBorder", -- TelescopePromptBorder = "TelescopeBorder", From 2ccdd3130a43bd66fa0b0164889fedf39b29ea86 Mon Sep 17 00:00:00 2001 From: A-Lamia Date: Thu, 2 Jan 2025 20:59:18 +1100 Subject: [PATCH 2/3] refactor(base): change floating window style logic --- lua/astrotheme/groups/base.lua | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lua/astrotheme/groups/base.lua b/lua/astrotheme/groups/base.lua index 6d5f919..75dea63 100644 --- a/lua/astrotheme/groups/base.lua +++ b/lua/astrotheme/groups/base.lua @@ -2,6 +2,17 @@ local function callback(c, opts) local color = require "astrotheme.lib.color" local base = color.new(c.ui.base) + + local float_bg = (opts.border and opts.float and opts.inactive and c.ui.float) + or (opts.border and opts.float and opts.transparent and c.ui.base) + or (opts.border and opts.float and c.ui.float) + or (opts.border and opts.inactive and c.ui.base) + or (opts.border and opts.transparent and c.none) + or (opts.float and c.ui.float) + or (opts.inactive and c.ui.base) + or (opts.border and c.ui.base) + or c.ui.base + return { -------------------- --- Normal @@ -20,32 +31,21 @@ local function callback(c, opts) -------------------- FloatTitle = { fg = (opts.title_invert and c.ui.tool) or c.ui.title, - bg = (opts.title_invert and c.ui.title) - or (opts.inactive and c.ui.float) - or (opts.transparent and opts.float and c.ui.base) - or (opts.float and c.ui.float) - or (opts.transparent and c.none) - or c.ui.base, + bg = (opts.title_invert and c.ui.title) or float_bg, bold = true, }, FloatBorder = { fg = (opts.border and opts.float and c.ui.border) - or (opts.transparent and opts.float and c.ui.base) + or (opts.border and opts.inactive and c.ui.border) or (opts.float and c.ui.float) + or (opts.transparent and c.ui.base) + or (opts.border and c.ui.border) or c.ui.base, - bg = (opts.inactive and c.ui.float) - or (opts.transparent and opts.float and c.ui.base) - or (opts.float and c.ui.float) - or (opts.transparent and c.none) - or c.ui.base, + bg = float_bg, }, NormalFloat = { fg = c.ui.text, - bg = (opts.inactive and c.ui.float) - or (opts.transparent and opts.float and c.ui.base) - or (opts.float and c.ui.float) - or (opts.transparent and c.none) - or c.ui.base, + bg = float_bg, }, -------------------- From b6af62c159c5f0c438798b25c0721b2449bd093f Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Thu, 2 Jan 2025 08:34:53 -0500 Subject: [PATCH 3/3] chore: ignore doc folder for typos --- .typos.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.typos.toml b/.typos.toml index 2843204..59ecb41 100644 --- a/.typos.toml +++ b/.typos.toml @@ -5,4 +5,4 @@ ba = "ba" aadd = "aadd" [files] -extend-exclude = ["CHANGELOG.md"] +extend-exclude = ["CHANGELOG.md", "doc/*"]