thaerkh / vim-indentguides

📐 Simple indentation guides for your buffers
Apache License 2.0
135 stars 11 forks source link

vim-indentguides breaks yaml syntax highlighting #18

Open campbellr opened 5 years ago

campbellr commented 5 years ago

I recently started using this plugin (and love it), but I noticed that for some reason when I have this plugin enabled it breaks the syntax highlighting in yaml files.

indentguides enabled:

Screen Shot 2019-08-28 at 11 06 54 AM

indentguides disabled:

Screen Shot 2019-08-28 at 11 07 27 AM

I thought this might be a neovim-specific issue, but I also see it on vim 8.0.1365.

hsychla commented 5 years ago

I have the same issue in Vim 8.0.1453

without: grafik

with: grafik

stonevil commented 4 years ago

Me too. Have an issues with yaml.ansible

ZeChArtiahSaher commented 3 years ago

+1

ghost commented 3 years ago

+1

rhssk commented 3 years ago

My guess is that the issue affects any syntax file that uses \s.

On NeoVIM v0.5.0: foo.vim

syn match fooComment "^\s*#.*$"
hi def link fooComment Comment

init.vim:

call plug#begin()
Plug 'thaerkh/vim-indentguides'
call plug#end()

Result: screenshot-2021-09-27_11-26-27

With --noplugin: screenshot-2021-09-27_11-26-41

Akulen commented 2 years ago

From what I can tell, the line causing this issue is https://github.com/thaerkh/vim-indentguides/blob/3152f3a0604089d545983b72e7cb676898bb7da1/plugin/indentguides.vim#L27 My best guess for now would be that yaml syntax (and https://github.com/cespare/vim-toml which is affected as well by this) condiders whitespace at the start of a line as part of a match they are trying to make, when they shouldn't and are affected by the whitespace being in a pattern match already

ptwales commented 2 years ago

Adding yaml and any other affected syntax to the ignore is what I'm doing for now.

let g:indentguides_ignorelist = ['yaml', 'toml']

It's not ideal because I lose indent guides on an indent dependent syntax but it's better than no syntax highlighting.

Also I don't think this plugin can punt the issue upstream, since these issue syntax definitions are bundled with vim (at least for me). Someone will have to have some sort of clever solution in this plugin.