Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor the fold text.

  • Loading branch information...
commit 1bf43c48e611d2b30b09e4e6e893afb4219fba20 1 parent 8858187
@nelstrom authored
Showing with 5 additions and 6 deletions.
  1. +5 −6 ftplugin/pml.vim
View
11 ftplugin/pml.vim
@@ -69,12 +69,11 @@ function! PmlFoldText()
let title = sectTitle
endif
- if match(getline(v:foldstart), "<sidebar") >= 0
- let entity = 'sidebar'
- elseif match(getline(v:foldstart), "<figure") >= 0
- let entity = 'figure'
- else
- let entity = v:foldlevel
+ " Use foldlevel as entity text for sections, or element name otherwise
+ let entity = v:foldlevel
+ let pattern = '<\zs\(sidebar\|figure\)\>'
+ if match(getline(v:foldstart), pattern) >= 0
+ let entity = matchstr(getline(v:foldstart), pattern)
endif
" Build the string that will be displayed as foldtext
Please sign in to comment.
Something went wrong with that request. Please try again.