Ben Baker-Smith  committed f6ac4e9

start regex excludes lines that also have a closing tag

  • Participants
  • Parent commits 95b3e18

Comments (0)

Files changed (1)

File plugin/liquidfold.vim

     " define fold regions using foldwords
     let foldwords = '\('.join(split(g:liquidfold_words,","),'\|').'\)'
-    let foldstart = '^.*{%\s\?'.foldwords.'.*%}.*$'
+    " exclude lines with both a close tag
+    let foldstart = '^.*{%\s\?\'.foldwords.'\(.*{%\s\?end'.foldwords.'.*\)\@!.*$'
+    " TODO exclude lines with an open tag
     let foldend = '^.*{%\s\?end'.foldwords.'.*%}.*$' 
     let foldcommand = "syn region LiquidFold start='".foldstart."' end='".foldend."' fold transparent keepend extend"
     execute foldcommand