Permalink
Browse files

Quickfix how YAML blocks are detected. This should resolve #44 withou…

…t any side effects
  • Loading branch information...
1 parent ec9a799 commit e4b3e3f7565257ec49f545693eb170d8dac54305 @pearofducks pearofducks committed Sep 12, 2015
Showing with 5 additions and 1 deletion.
  1. +5 −1 syntax/include/yaml.vim
@@ -37,7 +37,11 @@ syn match yamlDelimiter "[-,:]\s*" contained
syn match yamlBlock "[\[\]\{\}>|]"
syn match yamlOperator '[?+-]'
-syn region yamlMapping start='\w\+\%(\s\+\w\+\)*\s*\ze:' end='$' keepend oneline contains=yamlKey,yamlScalar
+" - yamlBlock is contained here in the mapping because having the mapping end
+" at $ clobbers detecting yamlBlock endings.
+" - Without re-writing quite a bit of this logic this seems like the cleanest
+" way to fix this
+syn region yamlMapping start='\w\+\%(\s\+\w\+\)*\s*\ze:' end='$' keepend oneline contains=yamlKey,yamlScalar,yamlBlock
syn match yamlScalar '\%(\W*\w\+\)\{2,}' contained contains=yamlTimestamp,yamlString,@yamlTypes,yamlBlock
syn cluster yamlTypes contains=yamlInteger,yamlFloating,yamlNumber,yamlBoolean,yamlConstant,yamlNull,yamlTime
syn match yamlKey '\w\+\%(\s\+\w\+\)*\s*:' contained nextgroup=@yamlTypes contains=yamlDelimiter

0 comments on commit e4b3e3f

Please sign in to comment.