[vim/vim] Syntax coloring for YAML files breaks on some quotes (#8234)

139 views
Skip to first unread message

UnitedMarsupials

unread,
May 21, 2021, 4:22:30 PM5/21/21
to vim/vim, Subscribed

Describe the bug
The syntax coloring for the YAML files messes up the colors in many situations...

To Reproduce
Try this YAML text in gvim:

 name: Get full list of services for {{ inp | join(', ') }}
  register: newservices
  changed_when: False
  check_mode: ansible_check_mode
  command: |-
    xmllint -format -pretty 1 -xpath /Foo/Bar

Expected behavior
Something similar to how GitHub's syntax-coloring code renders it.

Screenshots
Note, how the "text" begins on the second quote -- and never ends:
image

Environment (please complete the following information):

  • Vim version 8.2.1110
  • FreeBSD/11
  • GUI


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Bram Moolenaar

unread,
May 22, 2021, 12:09:30 PM5/22/21
to vim/vim, Subscribed

This syntax is maintained by Nikolai Pavlov, I don't know his github user name

UnitedMarsupials

unread,
May 22, 2021, 12:45:12 PM5/22/21
to vim/vim, Subscribed

This syntax is maintained by Nikolai Pavlov, I don't know his github user name

Can he -- his username -- not be tracked from commits to the relevant files, whatever they are?

Dominique Pellé

unread,
May 22, 2021, 12:58:59 PM5/22/21
to vim/vim, Subscribed

@brammool wrote:

This syntax is maintained by Nikolai Pavlov, I don't know his github user name

I found it: https://github.com/ZyX-I
But his last contribution in github is from Jul 2019.

Bram Moolenaar

unread,
May 22, 2021, 2:23:29 PM5/22/21
to vim/vim, Subscribed

@ZyX-I

Nesaijn

unread,
Jul 23, 2022, 10:19:23 AM7/23/22
to vim/vim, Subscribed

This seems to happen when the quote, single or double, comes right after a non-whitespace character. Because then it is not detected as a string delimiter for some reason.
The end quote does not seem to have that problem, when recognized as such. Because when the first quote is not recognized as one, then the end quote is seen as the beginning delimiter, which again has the same issue.

Maybe this gives someone an idea what the problem could be.
I, looking at a vim syntax file the first time, could see anything wrong with the string definition at these lines https://github.com/vim/vim/blob/c54f347d63bcca97ead673d01ac6b59914bb04e5/runtime/syntax/yaml.vim#L113-L120

It could be a matter of multiple matches as described here
https://github.com/vim/vim/blob/0d878b95d8f9ece2fdba81050f5caba224540f9c/runtime/doc/syntax.txt#L3714-L3729


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/8234/1193132916@github.com>

Christian Brabandt

unread,
Apr 1, 2024, 8:57:14 AM4/1/24
to vim/vim, Subscribed

Closed #8234 as completed via cc7597c.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/8234/issue_event/12310421988@github.com>

Reply all
Reply to author
Forward
0 new messages