sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.96k stars 166 forks source link

Error after upgrading to newest version #82

Closed lmburns closed 3 years ago

lmburns commented 3 years ago

Operating system:

ProductName:    macOS
ProductVersion: 11.2.3
BuildVersion:   20D91

Terminal: iTerm2 $TERM: xterm-256color Neovim version: NVIM v0.4.4; Build type: Release

Minimal vimrc that can reproduce this bug

  let g:gruvbox_material_palette = 'mix'
  let g:gruvbox_material_background = 'medium'
  let g:gruvbox_material_enable_bold = 1
  let g:gruvbox_material_diagnostic_virtual_text = 1 " happens with & without this

Steps to reproduce this bug using minimal vimrc

Updated to the newest version of gruvbox-material. I noticed this problem 2 days ago, and tried figuring out what the issue was but wasn't able to. Also, note that this may not have arisen directly because of the newest version because I don't upgrade my vim plugins but maybe once a week.

Actual behaviour

Screen Shot 2021-05-08 at 9 33 34 PM

Expected behaviour

No error. Very weird though, because the key definitely seems to be present in the dictionary.

Problem is fixed by deleting the following:

File: colors/gruvbox-material.vim

if s:configuration.diagnostic_virtual_text ==# 'grey'
  highlight! link VirtualTextWarning Grey
  highlight! link VirtualTextError Grey
  highlight! link VirtualTextInfo Grey
  highlight! link VirtualTextHint Grey
else
  highlight! link VirtualTextWarning Yellow
  highlight! link VirtualTextError Red
  highlight! link VirtualTextInfo Blue
  highlight! link VirtualTextHint Green
endif

File: autoload/gruvbox_material.vim Deleting this is not necessary, the error disappears after deleting the text from the previous file.

 \ 'diagnostic_virtual_text': get(g:, 'gruvbox_material_diagnostic_virtual_text', 'grey'),
sainnhe commented 3 years ago

https://github.com/sainnhe/gruvbox-material/blob/82c696585d9d7a72596d34a755a6080836ae6561/doc/gruvbox-material.txt#L339-L362

This variable should be a string, but you assigned it a number. Try let g:gruvbox_material_diagnostic_virtual_text = 'colored'

lmburns commented 3 years ago

I figured it out. I had another gruvbox_material.vim file located in another folder with a different name that neovim was calling on. I had changed that value to a digit in the dictionary when I was trying to debug what I thought was the problem and forgot to change it back.

Thank you for the quick reply