fix: respect explicitly loaded theme variants (#29)
This commit is contained in:
@@ -95,8 +95,8 @@ require('kanso').setup({
|
|||||||
return {}
|
return {}
|
||||||
end,
|
end,
|
||||||
background = { -- map the value of 'background' option to a theme
|
background = { -- map the value of 'background' option to a theme
|
||||||
dark = "ink", -- try "zen" !
|
dark = "ink", -- try "zen", "mist" or "pearl" !
|
||||||
light = "pearl" -- try "mist" !
|
light = "ink" -- try "zen", "mist" or "pearl" !
|
||||||
},
|
},
|
||||||
foreground = "default", -- "default" or "saturated" (can also be a table like background)
|
foreground = "default", -- "default" or "saturated" (can also be a table like background)
|
||||||
})
|
})
|
||||||
|
|||||||
+8
-2
@@ -25,7 +25,7 @@ M.config = {
|
|||||||
return {}
|
return {}
|
||||||
end,
|
end,
|
||||||
---@type { dark: string, light: string }
|
---@type { dark: string, light: string }
|
||||||
background = { dark = "ink", light = "pearl" },
|
background = { dark = "ink", light = "ink" },
|
||||||
theme = "ink",
|
theme = "ink",
|
||||||
---@type { dark: "default"|"saturated", light: "default"|"saturated" }|"default"|"saturated"
|
---@type { dark: "default"|"saturated", light: "default"|"saturated" }|"default"|"saturated"
|
||||||
foreground = "default",
|
foreground = "default",
|
||||||
@@ -52,7 +52,13 @@ end
|
|||||||
function M.load(theme)
|
function M.load(theme)
|
||||||
local utils = require("kanso.utils")
|
local utils = require("kanso.utils")
|
||||||
|
|
||||||
theme = theme or M.config.background[vim.o.background] or M.config.theme
|
-- If theme is explicitly provided, use it and disable background-based switching
|
||||||
|
if theme then
|
||||||
|
M._EXPLICIT_THEME = theme
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Use explicit theme if set, otherwise fall back to background-based selection
|
||||||
|
theme = M._EXPLICIT_THEME or M.config.background[vim.o.background] or M.config.theme
|
||||||
M._CURRENT_THEME = theme
|
M._CURRENT_THEME = theme
|
||||||
|
|
||||||
if vim.g.colors_name then
|
if vim.g.colors_name then
|
||||||
|
|||||||
Reference in New Issue
Block a user