bakks / butterfish.nvim

Neovim plugin for fluent coding with LLMs
https://butterfi.sh
52 stars 1 forks source link

Invalid highlight name: 'User1' #1

Closed mandrade2 closed 10 months ago

mandrade2 commented 10 months ago

Hey there! First of all thanks for this plugin, I think doing everything in place on the open buffer is a great approach.

I tried using the BFExplain command but got this.

E5108: Error executing lua .../share/nvim/lazy/butterfish.nvim/lua/butterfish/init.lua:43: Invalid highlight name: 'User1'
stack traceback:
        [C]: in function 'nvim_get_hl_by_name'
        .../share/nvim/lazy/butterfish.nvim/lua/butterfish/init.lua:43: in function 'set_status_bar'
        .../share/nvim/lazy/butterfish.nvim/lua/butterfish/init.lua:123: in function 'command'
        .../share/nvim/lazy/butterfish.nvim/lua/butterfish/init.lua:353: in function 'explain'
        [string ":lua"]:1: in main chunk

For anyone else having this, the solution is to use an existing highlight. You can do:hi to see the list of highlights you have. I am new to neovim and using NvChad so this might be useful for someone else.

Then you just do butterfish.active_color_group = "LazyH1" and you're good to go!

cjavdev commented 10 months ago

thank you for documenting the solution, I ran into the same problem!

bakks commented 10 months ago

Thanks for opening an issue and sorry for the difficulty - I suspected something was weird there but hadn't had time to figure it out. Looking now.

bakks commented 10 months ago

Ok I fixed the proximate issue but I don't quite understand the universe of highlight group names. I used User1 to set my statusline background but apparently that doesn't work for others. Investigating.

cjavdev commented 10 months ago

In case it's helpful:

I used (arbitrarily picked MoreMsg):

local butterfish = require('butterfish')
butterfish.active_color_group = "MoreMsg"
Screenshot 2024-01-04 at 3 38 58 PM
bakks commented 10 months ago

Ok I'm going to default this to StatusLine for now