vim-nerdtree-syntax-highlight icon indicating copy to clipboard operation
vim-nerdtree-syntax-highlight copied to clipboard

No longer work in recent Neovim v0.8.0

Open brainwo opened this issue 2 years ago • 9 comments

Upon upgrading to Neovim v0.8.0, I got this error:

Error detected while processing function projectroot#exe[7]..function projectroot#exe[4]..204[2]..205[14]..188[19]..194[16]..201[34]..FileType Auto
commands for "*"..Syntax Autocommands for "*"..function <SNR>61_SynSet[25]..script /home/brian/.local/share/nvim/plugged/vim-nerdtree-syntax-highli
ght/after/syntax/nerdtree.vim:
line  458:
E5248: Invalid character in group name
Press ENTER or type command to continue

brainwo avatar Oct 04 '22 05:10 brainwo

It looks like it is related to this neovim PR - https://github.com/neovim/neovim/pull/19830

cukejianya avatar Oct 08 '22 03:10 cukejianya

I created a fork where I removed all the keys with invalid characters https://github.com/johnstef99/vim-nerdtree-syntax-highlight/tree/master. This should not thrown any errors.

By my understanding this plugin always created Groups with invalid characters but as of nvim v0.8.0 instead of that resulting to just a message, now is resulting into an error message. As you can see here in line highlight_group.c:1756.

johnstef99 avatar Oct 23 '22 10:10 johnstef99

I created a fork where I removed all the keys with invalid characters

Thanks I will use your fork instead, seems like the maintainer of this repo is rarely active now.

brainwo avatar Oct 23 '22 11:10 brainwo

@johnstef99 Thank you! 🎉

martasd avatar Oct 24 '22 06:10 martasd

FWIW, here is a branch that preserves all of the highlight groups (i.e. doesn't delete entries) and doesn't throw errors: https://github.com/jcharum/vim-nerdtree-syntax-highlight/tree/escape-keys

It's a terrible hack to eliminate the (used) invalid characters from the group name construction.

jcharum avatar Oct 24 '22 18:10 jcharum

FWIW, here is a branch that preserves all of the highlight groups (i.e. doesn't delete entries) and doesn't throw errors: https://github.com/jcharum/vim-nerdtree-syntax-highlight/tree/escape-keys

It's a terrible hack to eliminate the (used) invalid characters from the group name construction.

yeah I know the right way was to escape the invalid chars, but I couldn't care less to not have 4 filetypes highlighted 😅. Thank you for doing that!!

johnstef99 avatar Oct 25 '22 08:10 johnstef99

@jcharum Even with your escape function if a new filetype was added with a char that isn't in [+,-,#] will result into an error. I refactored it so every invalid char will turn into an underscore (check here).

johnstef99 avatar Oct 25 '22 10:10 johnstef99

I created a fork where I removed all the keys with invalid characters https://github.com/johnstef99/vim-nerdtree-syntax-highlight/tree/master. This should not thrown any errors.

By my understanding this plugin always created Groups with invalid characters but as of nvim v0.8.0 instead of that resulting to just a message, now is resulting into an error message. As you can see here in line highlight_group.c:1756.

Would you like to create a PR in this repo?

griiid avatar Nov 05 '22 01:11 griiid

I created a fork where I removed all the keys with invalid characters https://github.com/johnstef99/vim-nerdtree-syntax-highlight/tree/master. This should not thrown any errors. By my understanding this plugin always created Groups with invalid characters but as of nvim v0.8.0 instead of that resulting to just a message, now is resulting into an error message. As you can see here in line highlight_group.c:1756.

Would you like to create a PR in this repo?

@Griiid there's already a PR submitted to this repo: https://github.com/tiagofumo/vim-nerdtree-syntax-highlight/pull/54.

brainwo avatar Nov 05 '22 02:11 brainwo

I created a fork where I removed all the keys with invalid characters https://github.com/johnstef99/vim-nerdtree-syntax-highlight/tree/master. This should not thrown any errors.

By my understanding this plugin always created Groups with invalid characters but as of nvim v0.8.0 instead of that resulting to just a message, now is resulting into an error message. As you can see here in line highlight_group.c:1756.

Huge bro!!

mustevenplay avatar Mar 17 '23 21:03 mustevenplay

FWIW, here is a branch that preserves all of the highlight groups (i.e. doesn't delete entries) and doesn't throw errors: https://github.com/jcharum/vim-nerdtree-syntax-highlight/tree/escape-keys

It's a terrible hack to eliminate the (used) invalid characters from the group name construction.

Perfect, it works like a charm!!!

Plug 'jcharum/vim-nerdtree-syntax-highlight', { 'branch' : 'escape-keys' }

@jcharum you should consider to submit a PR.

nerun avatar Jul 06 '23 16:07 nerun

Issue closed to avoid more off-topic comments.

~~For those who wanting a solution, there are currently two forks you can use:~~

Plug 'johnstef99/vim-nerdtree-syntax-highlight'
Plug 'jcharum/vim-nerdtree-syntax-highlight', { 'branch' : 'escape-keys' }

~~There is already a proposed pull request https://github.com/tiagofumo/vim-nerdtree-syntax-highlight/pull/54, but seems like the maintainer of this repo is unavailable at the moment. For now, just stick with one of the forks.~~

Update: it's merged 🎉🎉🎉

brainwo avatar Jul 06 '23 22:07 brainwo