pearofducks / ansible-vim

A vim plugin for syntax highlighting Ansible's common filetypes
MIT License
800 stars 98 forks source link

fix: improve name key match #137

Open gardar opened 1 year ago

gardar commented 1 year ago

This refines the matching for the name key to only target instances where it's an item in a list. This change significantly reduces the likelihood of false positives.

Related Issue: #109

The highlighting now looks like this: image

However, there are still some edge cases to be aware of: image

Which you could work around like so: image

pearofducks commented 1 year ago

I haven't merged this yet, I'm taking a bit to think about it.

The regex here also grabs the - which I really don't like - and I'm also hesitant to introduce any regex - YAML is pretty flexible and there's all sorts of bonkers things people could get up to, I'd rather stick to extending what the YAML syntax file provides than start bashing that with custom regex/selections.