SublimeText / PackageDev

Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
MIT License
436 stars 83 forks source link

[Syntax Def] Syntax gets confused with YAML multiline strings #108

Closed rwols closed 7 years ago

rwols commented 7 years ago

Pictures say it all I guess:

schermafbeelding 2017-05-28 om 16 23 31 schermafbeelding 2017-05-28 om 16 23 45

Sublime seems to parse this OK.

FichteFoll commented 7 years ago

They are valid YAML, but I assumed (or hoped, rather) that people wouldn't use block scalars for key like this. Will have to think about whether adding support for it will be worth it or not.

The exact result in your screenshots are a bit unexpected though. I intended for the context to reset upon seeing a - sequence, but I might have missed that. Will definitely take a look at that.

rwols commented 7 years ago

Yeah, it's the first time I'm using it. I thought if I just use a multi line string at two places then my whole file is nicely indented with 80 chars.

FichteFoll commented 7 years ago

FYI, you can just continue plain scalars on the next line, if it is indented with more spaces. This should be highlighted fine. Newline and surrounding spaces will be collapsed at parse time.

rwols commented 7 years ago

This is what I did and it indeed works fine. Thanks!