vim-indentguides icon indicating copy to clipboard operation
vim-indentguides copied to clipboard

vim-indentguides breaks yaml syntax highlighting

Open campbellr opened this issue 6 years ago • 7 comments
trafficstars

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.

campbellr avatar Aug 28 '19 17:08 campbellr

I have the same issue in Vim 8.0.1453

without: grafik

with: grafik

hsychla avatar Oct 14 '19 15:10 hsychla

Me too. Have an issues with yaml.ansible

stonevil avatar Sep 20 '20 06:09 stonevil

+1

ZeChArtiahSaher avatar Mar 23 '21 14:03 ZeChArtiahSaher

+1

ghost avatar Jun 16 '21 12:06 ghost

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

rhssk avatar Sep 27 '21 08:09 rhssk

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

Akulen avatar Dec 08 '21 13:12 Akulen

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.

ptwales avatar May 03 '22 15:05 ptwales