[vim/vim] yamlPlainScalar globs all special characters until whitespace in yaml syntax highlighting (Issue #15444)

7 views
Skip to first unread message

Eugenio Bargiacchi

unread,
Aug 7, 2024, 10:15:12 AM8/7/24
to vim/vim, Subscribed

Steps to reproduce

  1. Write a .yaml file
  2. Write a: foo("{ }")
  3. The string does not open at the first quotes, but only at the second, and keeps going from there.
  4. Write b: foo("abc")
  5. String is not recognized as such.

Expected behaviour

I have detected the type of the first part as a yamlPlainScalar by running the following command with the cursor on it:

:let s = synID(line('.'), col('.'), 1) | echo synIDattr(s, 'name') . ' -> ' . synIDattr(synIDtrans(s), 'name')

As far as I can see, yamlPlainScalar is the "default" token. It seems that once it starts it only ends for whitespace. I would expect it to end on parentheses, quotes and other special characters and not glob them all.

I tried to debug the syntax file but it is beyond me unfortunately.

Version of Vim

VIM - Vi IMproved 9.1 Included patches: 1-16

Environment

Lubuntu 24.04

Logs and stack traces

No response


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/15444@github.com>

Eugenio Bargiacchi

unread,
Aug 7, 2024, 10:25:58 AM8/7/24
to vim/vim, Subscribed

This seems to be very related to #8234 .


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/15444/2273606140@github.com>

itchyny

unread,
Sep 20, 2024, 9:57:50 AM9/20/24
to vim/vim, Subscribed

In YAML syntax, there is no special meaning in double quoted string inside a plain (=unquoted) style string. So b: foo("abc") has a plain style string foo("abc") and that's all. To recognize "abc" as a string, that'll require an embedded syntax inside YAML. So the remaining issue here is that { } in a: foo("{ }") is incorrectly recognized as a mapping (object).


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/15444/2363804502@github.com>

Reply all
Reply to author
Forward
0 new messages