Comments (7)
This has been a bug for a long, long time. I was able to fix it in an older commit with this patch:
index f785fdb..27d8282 100644
--- a/lua/catppuccin/lib/highlighter.lua
+++ b/lua/catppuccin/lib/highlighter.lua
@@ -36,7 +36,7 @@ function M.load(theme)
end
g.colors_name = "catppuccin"
- M.properties(theme.properties, "o")
+ -- M.properties(theme.properties, "o")
M.syntax(vim.tbl_deep_extend("keep", theme.custom_highlights, theme.integrations, theme.syntax, theme.editor))
if require("catppuccin.config").options["term_colors"] then
Just updated tonight and noticed it's broken still. That module has also been deprecated.
from nvim.
You can work around the issue by loading the color scheme after the background option is set,
vim.api.nvim_create_autocmd("OptionSet", {
pattern = "background",
callback = function()
vim.cmd("Catppuccin " .. (vim.v.option_new == "light" and "latte" or "mocha"))
end,
})
Edit: If you are using something like lualine that references catppuccin, you'll also want to put its setup in the callback function, or the colors will be based on mocha (?).
from nvim.
I added a quick fix
Try this:
require("catppuccin").setup { flavour = "auto" }
auto_flavour.mp4
from nvim.
I gave that a try and something weird happens:
- If I set my GNOME theme as Light, Neovim will open with CTP latte (everything fine with this)
- If I set my GNOME theme to Dark, Neovim will not load the CTP theme (well, the theme is loaded, it just not being applied)
- The bg var is set to dark correctly, tho
- I can manually the theme doing colorscheme catppuccin-[flavour]
nvim-issue.webm
from nvim.
Super new to Neovim but I think this is happening for me as well. With flavour = "auto"
set, the light theme loads just fine but the dark theme doesn't look right. Running :colorscheme catppuccin-[flavour]
produces the ideal result.
I'm using macOS / AstroNvim.
from nvim.
if (option_was_set("bg") || strequal(p_bg, value)) {
// background is already set... ignore
return;
}
if (starting) {
// Wait until after startup, so OptionSet is triggered.
do_cmdline_cmd((value[0] == 'l')
? "autocmd VimEnter * ++once ++nested :lua if not vim.api.nvim_get_option_info2('bg', {}).was_set then vim.o.bg = 'light' end"
: "autocmd VimEnter * ++once ++nested :lua if not vim.api.nvim_get_option_info2('bg', {}).was_set then vim.o.bg = 'dark' end");
} else {
Referring to the neovim 0.9.5 code, an OptionSet event won't happen if:
- bg was explicitly set,
- or term bg is dark.
I guess, CAT should respect, but not depend on, OptionSet events, when "auto" is used.
Preferably, monitor bg change and respond automatically without restarting nvim.
from nvim.
I can confirm that with the recent changes, using require("catppuccin").setup { flavour = "auto" }
, it works.
I'm gonna close this since it is resolved with that change. In case flavour = "auto"
is not already documented on the README, I will do the PR myself.
Tysm guys !
from nvim.
Related Issues (20)
- bug: black screen and small delay when opening a python file HOT 3
- 836de8b breaks using LSP colors in the custom_highlights HOT 2
- NeoTree background does not blend with the WinSeparator as shown in README screenshots. HOT 5
- React (JSX) code does not show different colors for variables. HOT 3
- Additional dim_inactive option for transparent setups
- Comments and Virtual Text same color HOT 3
- Semantic Highlighting - basedpyright HOT 6
- Treesitter context highlighting when transparent_background=true HOT 3
- (option to) Disable all integrations by default HOT 1
- Incorrect typing for `illuminate` integration
- add tabby.nvim integration (colors) HOT 1
- Incorrect Typescript keyword color with TreeSitter enabled HOT 2
- Bufferline background breaks when Catppuccin is set to transparent background and bufferline style is styled as non-default HOT 4
- nvim-navbuddy integration
- Publish plugin on luarocks
- Lualine highlight color is not uniform
- lazy.nvim: module 'catppuccin.groups.integrations.colorful_winsep' HOT 5
- Add support for `mini.statusline` HOT 1
- mini.nvim integration seems broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim.