Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

vim-indentguides breaks yaml syntax highlighting #18

Open
campbellr opened this issue Aug 28, 2019 · 7 comments
Open

vim-indentguides breaks yaml syntax highlighting #18

campbellr opened this issue Aug 28, 2019 · 7 comments

Comments

@campbellr
Copy link

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
Copy link

hsychla commented Oct 14, 2019

I have the same issue in Vim 8.0.1453

without:
grafik

with:
grafik

@stonevil
Copy link

Me too. Have an issues with yaml.ansible

@ZeChArtiahSaher
Copy link

+1

1 similar comment
@ghost
Copy link

ghost commented Jun 16, 2021

+1

@rhssk
Copy link

rhssk commented Sep 27, 2021

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
Copy link

Akulen commented Dec 8, 2021

From what I can tell, the line causing this issue is

execute 'syntax match IndentGuideSpaces /^\ \+/ containedin=ALL contains=IndentGuideDraw keepend'

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
Copy link

ptwales commented May 3, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants