Closed ches closed 10 years ago
I appreciate the detailed report, @ches! Unfortunately, maintaining this project isn't one of my highest priorities right now. I'm glad you found it useful, but I can't guarantee that I will have this fixed anytime soon.
If you do decide to learn up on the ways of Vim, here are some excellent resources I have used in the past: Vim Docs: Defining a syntax Vim Tips Wiki: Creating your own syntax files
The place you would want to look first to solve your problem would be syntax/include/yaml.vim.
No worries, completely understand and appreciate the honesty. I'll give it a look when I have a few minutes, seems like it's probably a pretty simple case, I was just already buried in other documentation and syntax definitions would be a costly context switch at the moment. I'll report back when I can make some headway.
Yep, the pipe character confuses the highlighting. Anyone fixed this?
Probably not. After I finish up some other projects this weekend, I might do some syntax fixing :+1:
Thanks, would appreciate it. Tried looking in it myself, but it all looks like Chinese to me..
Alright, well it looks like this is caused by the incorrect assumption that anything following a bar character is a scalar block, not just bars at the end of the line. I'll start working on an efficient solution.
On a side note, fixing a syntax file in Vim is kind of like playing tug of war with a rhino.
lol, thanks for doing this :)
Any luck? :cry:
It's a work in progress, although as I have stated before: this is a low-priority project of mine. Real work comes first.
So far I've redone the syntax to support key pair recognition, that way values will be recognized appropriately and there won't be mismatches to out-of-pair elements. What I have left to do:
>
or |
and the preceding value is a scalar string or empty@ches @rafi While I'm working on a more proper fix, you can remove scalar highlighting if you wish:
vim-ansible-yaml/syntax/include/yaml.vim
syn match yamlScalar '\(\(|\|>\)\s*\n*\r*\)\@<=\(\s\+\).*\n*\r*\(\(\3\).*\n\)*'
Fixed in c6aca1c1938b75b102d9a6fcb9ca98de5a584b9d
Thanks!
Thanks for your time!
Heya, cool idea for this plugin, thanks for creating it!
I've found that with it installed and the filetype detection correctly working, the bar character is breaking my YAML syntax highlighting. It's a pretty common convention to use bars in task names since some of Ansible's own output formatting uses them too. Here's an example:
On my setup, the Jinja highlighting is working for the
{{ }}
(sweet!), but unfortunately everything else after the bar is not highlighted correctly.I'm not schooled in the arts of Vim syntax definitions, so apologies for not trying to fix -- I'll take a stab if I have some time to learn up. Hopefully the example is enough to reproduce, let me know if any more detail about my setup is helpful.