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/*"] 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, }, -------------------- 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",