rktjmp / lush.nvim

Create Neovim themes with real-time feedback, export anywhere.
MIT License
1.4k stars 46 forks source link

`:LushImport` broken #113

Closed uloco closed 1 year ago

uloco commented 1 year ago

When I try to run :LushImport I get the following error:

E5108: Error executing lua ...m/site/pack/packer/start/lush.nvim/lua/lush/importer.lua:103: bad argument #1 to 'len' (string expected, got nil)
stack traceback:
        [builtin:len]: in function 'len'
        ...m/site/pack/packer/start/lush.nvim/lua/lush/importer.lua:103: in function 'import'
        [string ":lua"]:1: in main chunk
rktjmp commented 1 year ago

Can't reproduce it locally, but it might be related to the theme in use, as it's failing to parse out a linked group name.

https://github.com/rktjmp/lush.nvim/blob/979f4d206e7111c2b710aa85cc723f6140d2ec98/lua/lush/importer.lua#L101-L105

Do you have more details on your config, probably just the theme you're trying to import.

uloco commented 1 year ago

You are right, looks like there is something wrong with my theme. I'm porting bluloco from vscode to neovim and this is the repo https://github.com/uloco/bluloco.nvim on branchdevelop.

I probably don't need this command since theme is quite big already, but I wanted to see which highlight groups I missed.

rktjmp commented 1 year ago

I'm a bit confused, you shouldn't need to use the importer unless you have an existing neovim theme that you want to port to lush (i.e. port tokyonight into lush for your own changes). Otherwise you should be able to open your theme and run :Lushify.

What theme were you trying to import?

uloco commented 1 year ago

oh ok maybe I misunderstood the purpose. I thought I could also import my existing lush theme to see all highlight groups (also the ones I did not theme explicitly).

rktjmp commented 1 year ago

Nah, it can only see what is defined by the loaded theme, so if you load your own theme you'll just get back the same data (or should...).

What you may want to do is load up some popular themes, import them, stick them all in one file, sort the file and de-dup (or count the dups) the group names. That would give you a good idea of whats standard and whats most popular.