Skip to content

Commit 567f886

Browse files
committed
feat: respect vim.o.background when set to light/dark
1 parent 3a8f753 commit 567f886

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

.neoconf.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"neodev": {
3+
"library": {
4+
"enabled": true,
5+
"plugins": true
6+
}
7+
},
8+
"neoconf": {
9+
"plugins": {
10+
"lua_ls": {
11+
"enabled": true
12+
}
13+
}
14+
},
15+
"lspconfig": {
16+
"lua_ls": {
17+
"Lua.format.enable": false
18+
}
19+
}
20+
}

lua/astrotheme/init.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ local util = require "astrotheme.lib.util"
44
local M = { config = {} }
55

66
function M.load(theme)
7-
if not theme then
8-
theme = M.config.palette
9-
else
10-
M.config.palette = theme
7+
if
8+
theme
9+
and theme == M.config.palette
10+
and vim.o.background ~= (M.config.palette == M.config.background["light"] and "light" or "dark")
11+
then
12+
theme = M.config.background[vim.o.background]
1113
end
14+
M.config.palette = theme
1215
util.reload(M.config, theme)
1316

1417
C = util.set_palettes(M.config)

lua/astrotheme/lib/config.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ M.default = {
1313
neotree = true,
1414
italic_comments = true,
1515
},
16-
background = "dark",
16+
background = {
17+
light = "astrolight",
18+
dark = "astrodark",
19+
},
1720
palettes = {
1821
global = {},
1922
astrodark = {},

0 commit comments

Comments
 (0)