Skip to content

Commit

Permalink
feat(colorschemes)!: persist g:colors_name with the flavor suffix (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Apr 29, 2023
1 parent 653ca9e commit 7a7a664
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lua/catppuccin/lib/compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ return string.dump(function()
vim.o.termguicolors = true
if vim.g.colors_name then vim.cmd("hi clear") end
vim.o.background = "%s"
vim.g.colors_name = "catppuccin"
vim.g.colors_name = "catppuccin-%s"
local h = vim.api.nvim_set_hl]],
flavour == "latte" and "light" or "dark"
flavour == "latte" and "light" or "dark",
flavour
),
}
if path_sep == "\\" then O.compile_path = O.compile_path:gsub("/", "\\") end
Expand Down
5 changes: 3 additions & 2 deletions lua/catppuccin/lib/vim/compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ if exists("colors_name")
endif
set termguicolors
set background=%s
let g:colors_name = "catppuccin"]],
(flavour == "latte" and "light" or "dark")
let g:colors_name = "catppuccin-%s"]],
(flavour == "latte" and "light" or "dark"),
flavour
),
}

Expand Down

3 comments on commit 7a7a664

@anstadnik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this commit, I have a race condition.

return {
  {
    "catppuccin/nvim",
    name = "catppuccin",
    lazy=false,
    priority=1000,
    commit="7a7a6646769e0c0be5d443cf55c04970f90fd230",
    config = function()
      require("catppuccin").setup {}
      vim.opt.background = "light"
      vim.cmd.colorscheme "catppuccin"
    end,
  },

Usually, the colorscheme is default after the nvim is loaded

@nullchilly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anstadnik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nullchilly Words great, thx :)

Please sign in to comment.