-" set foldlevel according to number of matches of 'namespace' and 'class' not
-" containing ';'
-function! InitialFoldLevel()
- let v:errmsg = ""
- keepjumps keeppatterns silent! 1,/}/s/^\(namespace\|class\) \+[^;]*$//n
- if v:errmsg == ""
- let &foldlevel=str2nr(split(v:statusmsg)[0])
- endif
-endf
-call InitialFoldLevel()