I have a syntax I'm trying do make. It's
yaml embedded in
markdown for use with Hugo. The
yaml region is enclosed by
--- and this must be at the top of the file.
--- [yaml front matter stuff] . . . --- # Here starts the markdown
I've defined a region that specifies where the
yaml region should start:
syn region yamlBlock matchgroup=quasiQuote start=/^---/ end=/^---/ contains=@yaml
(inspired by this embedded haskell syntax file)
I want this region to only apply if it is at the very top of the file.
I've tried adding an
if getline(1) =~ '---' syn region yamlBlock matchgroup=quasiQuote start=/^---/ end=/^---/ contains=@yaml endif
But this will only update when the buffer is reloaded. ie. If I have it open and add a blank line at the top of the file, the code inside
--- [....] ---
will still be highlighted as