uloco / bluloco.nvim

bluloco theme port for neovim
GNU Lesser General Public License v3.0
298 stars 10 forks source link

Error when trying to apply the colorscheme: "error loading module 'lush_theme.bluloco'" #47

Open emilBeBri opened 1 year ago

emilBeBri commented 1 year ago

Hi I'm getting this error when calling the colorscheme - does not matter if I choose it through telescope or natively:


E5108: Error executing lua ...lazy/telescope.nvim/lua/telescope/builtin/__internal.lua:988: Vim(colorscheme):E5113: Error while calling lua chunk: ....local/share/nvim/lazy/bluloco.nvim/lua/bluloco/init.lua:28: lo
op or previous error loading module 'lush_theme.bluloco'
stack traceback:
        [C]: in function 'require'
        ....local/share/nvim/lazy/bluloco.nvim/lua/bluloco/init.lua:28: in function 'load'
        ...l/.local/share/nvim/lazy/bluloco.nvim/colors/bluloco.lua:12: in main chunk
        [C]: in function 'cmd'
        ...lazy/telescope.nvim/lua/telescope/builtin/__internal.lua:988: in function 'run_replace_or_original'
        ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
        ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:352: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk
stack traceback:
        [C]: in function 'cmd'
        ...lazy/telescope.nvim/lua/telescope/builtin/__internal.lua:988: in function 'run_replace_or_original'
        ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
        ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:352: in function 'execute_keymap'
        [string ":lua"]:1: in main chunk

I'm using lazy and I'm installing it like this:

return{

{
  'uloco/bluloco.nvim',
  lazy = false,
  priority = 1000,
  dependencies = { 'rktjmp/lush.nvim' },
  config = function()
    require('bluloco').setup{

    -- your optional config goes here, see below.
    style = "auto",               -- "auto" | "dark" | "light"
    transparent = false,
    italics = false,
    terminal = vim.fn.has("gui_running") == 1, -- bluoco colors are enabled in gui terminals per default.
    guicursor   = true, 
    }
    -- vim.cmd.colorscheme 'bluloco'
    end,
}

}

I can change theme to other stuf like Carbon fox or Tokyonight just fine.

I'm still learning nvim so I apologize if I'm missing some important information, or not seeing something obvious. Please correct me in this case. thank you for this wonderful theme, that I like to be able to use :D

uloco commented 1 year ago

Unfortunately I am still not using lazy and don't know what could be the issue. The error message sounds like you are importing it already somewhere or something? Are you using the latest version of lush and bluloco.nvim?.

uloco commented 1 year ago

Also try loading the theme with vim.cmd('colorscheme bluloco') after the setup function

emilBeBri commented 1 year ago

I'm using version 1.2.0 of bluloco and 2.0.1 of lush, should be the newest versions.

I put blucolo at the very end of my init.lua like this:

vim.cmd [[colorscheme bluloco]]

also tried

vim.cmd('colorscheme bluloco')

still the same thing happens. Can load other colorschemes just fine.

Perhaps it's because it is using lush, and for some reason it's not getting loaded before bluloco?

tried putting it before bluloco like this:


return{

{'rktjmp/lush.nvim', lazy=false},

{ 'uloco/bluloco.nvim', lazy=false,
  dependencies = { 'rktjmp/lush.nvim' },
    },

}

but that did not work either. Strange.

uloco commented 1 year ago

@surmish @Jezda1337 Sorry for bothering, but I think you both managed to get it to work with lazy package manager. Are you still using it and have any ideas what could be the issue here?

Jezda1337 commented 1 year ago

Hey @uloco and @emilBeBri, I managed to set up a theme with lazy.nvim, but I didn't get such a message as @emilBeBri got. My configuration goes like this:

    {
        "uloco/bluloco.nvim",
        lazy = true,
        priority = 1000,
        dependencies = { "rktjmp/lush.nvim" },
        config = function()
            require("bluloco").setup({
                -- your optional config goes here, see below.
                style = "auto", -- "auto" | "dark" | "light"
                transparent = false,
                italics = false,
                terminal = vim.fn.has("gui_running") == 1, -- bluoco colors are enabled in gui terminals per default.
                guicursor = true,
            })
        end,
    },

I have separate file for theme (theme.lua) and I just call vim.cmd("colorscheme bluloco"). My problem was, after I install the theme I didn't get manage to apply the theme, even after calling colorscheme the theme didn't apply. The reason behind that was set termguicolors or vim.opt.termguicolors = true for lua. Here is the short video of my problem:

https://user-images.githubusercontent.com/42359294/222713709-0b604dd0-529e-45a8-bc17-4bdd1d4a2af3.mov

You can see that the theme is not applied until I set termguicolors. I apologize for the long answer. I hope the answer will be useful to someone. Tested on neovim stable and nightly using Kitty(my primary), Iterm, alacritty and warp.

surmish commented 1 year ago

@uloco previous versions of lazy.nvim defaulted to using latest released versions of plugins. For plugins which don't have release tags, it was using fairly old (7-8 months old) version of bluloco and the lush.nvim. One option is to set version = false in lazy config. Other option is to use latest lazy.nvim and LazyVim (@folke had changed version to false by default in later releases)

@emilBeBri Another common change while using lazy.nvim is config -> opt

  {
    "uloco/bluloco.nvim",
    priority = 1000,
    version = false,
    dependencies = { "rktjmp/lush.nvim" },
    opts = {
      -- your optional config goes here, see below.
      style = "dark", -- "auto" | "dark" | "light"
      transparent = false,
      italics = false,
    },
  },
folke commented 1 year ago

Yeah, had to change that back since a lot plugins that have releases don't really make releases unfortunately, so a lot of plugins were really outdated or broken...

emilBeBri commented 1 year ago

Still the same errors even with surmiss suggestions. So odd.

uloco commented 1 year ago

Thanks everyone for helping out :)

But i guess it is something different... Why does the error message contain telescope, this looks odd to me...

Jezda1337 commented 1 year ago

Maybe we can help more if @emilBeBri share his config. 🫡

Murderlon commented 1 year ago

I'm also getting this error but with:

bluloco.nvim/lua/lush_theme/bluloco.lua:238: attempt to index local 'injected_functions' (a nil value)

could it be that injected_functions is sometimes not defined?

https://github.com/uloco/bluloco.nvim/blob/27ad647f0fc3270e732add1533ad9bcbf702f24e/lua/lush_theme/bluloco.lua#L234

uloco commented 1 year ago

that's weird. it should be provided by lush, I don't think I have influence on this.... Maybe there is a problem loading it or lush is not ready yet. It sounds like a kind of race condition or similar. Could you maybe provide more debugging info, since I am unable to debug this on my own right now.

uloco commented 9 months ago

@emilBeBri Do you still have this issue? Would you mind sharing your config so we can fix or close this issue finally? :)

Murderlon commented 9 months ago

I'm still experiencing it. Unfortunately I wasn't able to create a small reproducible example.

This is the only theme from the lush.nvim themes that has this problem in my experience though. In fact, LazyVim comes with habamax.nvim (based on lush) by default and it works.

Murderlon commented 9 months ago

Update: I get a similar error with zenbones.nvim also based on lush. Maybe this is a lush and/or lazyvim issue 🤔