NvChad / base46

NvChad's base46 theme plugin with caching ( Total re-write )
Other
187 stars 194 forks source link

when use `rmagatti/auto-session ` , some theme colors are incorrect #303

Closed zerlei closed 5 months ago

zerlei commented 5 months ago

Describe the bug some colors display incorrect

To Reproduce Steps to reproduce the behavior:

  1. in nvim, set colortheme
  2. quit nvim
  3. re enter nvim, some colors are incorrect
  4. reset colortheme ,These colors become correct

Expected behavior colors are correct

Screenshots

https://github.com/NvChad/NvChad/assets/40014687/2cbc4a99-0726-4abc-bded-c4631a6f1d1c

Desktop (please complete the following information):

siduck commented 5 months ago

did you override treesitter config function? i hope you didnt remove our dofile code which loads ts highlights

zerlei commented 5 months ago

did you override treesitter config function? i hope you didnt remove our dofile code which loads ts highlights

No, I just forked Nvchard/starter, and added some lines in /lua/plugins/init.lua

{
    "nvim-treesitter/nvim-treesitter",
    opts = {
      ensure_installed = {
        "vim",
        "lua",
        "html",
        "css",
        "javascript",
        "typescript",
        "tsx",
        "c",
        "cpp",
        "markdown",
        "markdown_inline",
        "cmake",
      },
    },
  },
siduck commented 5 months ago

TSInstall vue

zerlei commented 5 months ago

Thank you siduck! I found out that my problem was because I added a plugin called 'rmagatti/autosession'. When I commented out this plugin, everything was fine...

{
    "rmagatti/auto-session",
    init = function()
      require("auto-session").setup {
        log_level = "error",
        auto_session_enable_last_session = true,
        auto_save_enabled = true,
        auto_restore_enabled = true,
        session_lens = {
          -- If load_on_setup is set to false, one needs to eventually call `require("auto-session").setup_session_lens()` if they want to use session-lens.
          buftypes_to_ignore = {}, -- list of buffer types what should not be deleted from current session
          load_on_setup = true,
          theme_conf = { border = true },
          previewer = false,
        },
      }

      -- todo add keymap manager
      -- vim.keymap.set("n", "<leader>ss", require("auto-session.session-lens").search_session, {
      --   noremap = true,
      -- })
    end,
  },
siduck commented 5 months ago

@ZhaoYouYa yes i have faced this issue with that plugin only, either use other autosession plugins or add this in your main init.lua

dofile(vim.g.base46_cache .. "syntax")
dofile(vim.g.base46_cache .. "treesitter")
zerlei commented 5 months ago

@ZhaoYouYa yes i have faced this issue with that plugin only, either use other autosession plugins or add this in your main init.lua

dofile(vim.g.base46_cache .. "syntax")
dofile(vim.g.base46_cache .. "treesitter")

Thank you! I add this in my init.lua,This solves my problem

vim.schedule(function()
   dofile(vim.g.base46_cache .. "syntax")
   dofile(vim.g.base46_cache .. "treesitter")
 end)