Browse files

Create an array of elements to be folded.

  • Loading branch information...
1 parent 1bf43c4 commit 31d7ff96499dc71ec21cb678adfe0d8a3c406789 @nelstrom committed Jun 25, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 ftplugin/pml.vim
View
3 ftplugin/pml.vim
@@ -22,6 +22,7 @@ if exists('loaded_taglist') && loaded_taglist != 'no'
endif
" PML specific folding {{{1
+let s:elements = ['sidebar', 'figure']
function! PmlFolds()
if match(getline(v:lnum), "<sect1") >= 0
return ">1"
@@ -71,7 +72,7 @@ function! PmlFoldText()
" Use foldlevel as entity text for sections, or element name otherwise
let entity = v:foldlevel
- let pattern = '<\zs\(sidebar\|figure\)\>'
+ let pattern = '<\zs\(' . join(s:elements, '\|') . '\)\>'
if match(getline(v:foldstart), pattern) >= 0
let entity = matchstr(getline(v:foldstart), pattern)
endif

0 comments on commit 31d7ff9

Please sign in to comment.