Permalink
Browse files

Refactor the foldtext.

  • Loading branch information...
1 parent 7ca1491 commit 885818715753b460a76b813a2817ec65a481169d @nelstrom committed Jun 25, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 ftplugin/pml.vim
View
10 ftplugin/pml.vim
@@ -69,14 +69,16 @@ function! PmlFoldText()
let title = sectTitle
endif
- " Build the string that will be displayed as foldtext
if match(getline(v:foldstart), "<sidebar") >= 0
- let metadata = printf("%4s lines (%s) ", foldedlinecount, 'sidebar')
+ let entity = 'sidebar'
elseif match(getline(v:foldstart), "<figure") >= 0
- let metadata = printf("%4s lines (%s) ", foldedlinecount, 'figure')
+ let entity = 'figure'
else
- let metadata = printf("%4s lines (%s) ", foldedlinecount, v:foldlevel)
+ let entity = v:foldlevel
endif
+
+ " Build the string that will be displayed as foldtext
+ let metadata = printf("%4s lines (%s) ", foldedlinecount, entity)
return "+" . v:folddashes . v:folddashes . metadata . title
endfunction

0 comments on commit 8858187

Please sign in to comment.