ribru17 / bamboo.nvim

Warm Green Theme for Neovim and Beyond
Other
320 stars 11 forks source link

No CocMenuSel colors #24

Closed shuckster closed 4 months ago

shuckster commented 4 months ago

I've noticed this since the dropbar commit because I had a little hack to copy the PmenuSel colours to CocMenuSel in my config:

function! UpdatePmenuSel()
  " Get the current colors of PmenuSel
  let pmenu_fg = synIDattr(hlID('PmenuSel'), 'fg#')
  let pmenu_bg = synIDattr(hlID('PmenuSel'), 'bg#')
  let pmenu_gui = synIDattr(hlID('PmenuSel'), 'gui')

  if empty(pmenu_fg)
    let pmenu_fg = 'NONE'
  endif

  if empty(pmenu_bg)
    let pmenu_bg = 'NONE'
  endif

  if empty(pmenu_gui)
    let pmenu_gui = 'NONE'
  endif

  " Build the highlight command
  let highlight_cmd = 'highlight CocMenuSel guifg=' . pmenu_fg . ' guibg=' . pmenu_bg . ' gui=' . pmenu_gui

  highlight_cmd
  echom highlight_cmd

  " Execute the highlight command
  execute highlight_cmd
endfunction

call UpdatePmenuSel()

autocmd ColorScheme * call UpdatePmenuSel()

Without the above the CoC menu-selection colours are invisible.

I do notice that your theme supports CoC, so perhaps I did something wrong myself? I accept this could be an issue elsewhere in my config.

Anyway, I really like the Bamboo theme, so thank you regardless of whether or not this issue is relevant.

ribru17 commented 4 months ago

Ah, sorry about that! Thanks for the issue. I will try highlighting the group manually (instead of linking to Visual). I have found that when you have a linked group, you cannot just use synIDattr(hlID('PmenuSel'), 'bg#') to get background color. Let me know if this next commit fixes the issue for you. If not, I will just revert that whole part of the change. Sorry and thanks again for the report!

PS Just out of curiosity, is there any reason you are using this method rather than hi! link CocMenuSel PmenuSel?

shuckster commented 4 months ago

I have found that when you have a linked group, you cannot just use synIDattr(hlID('PmenuSel'), 'bg#') to get background color.

PS Just out of curiosity, is there any reason you are using this method rather than hi! link CocMenuSel PmenuSel?

Interesting information, thank you!

On the second point, it's just ignorance: I'm pretty new to Vim + NeoVim, and don't know all the ins-and-outs. I'll try out the above line - it's way simpler, thank you.

I'll also try your recent commit and report back.

shuckster commented 4 months ago
hi! link CocMenuSel PmenuSel

This, along with your recent commit, fixed the menu-selection colour for me.

Thank you!

ribru17 commented 4 months ago

Glad to hear it, thanks for reporting back!