1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 19:40:27 +01:00

Don't fold comments

This commit is contained in:
Jan Larres
2011-02-14 22:10:30 +13:00
parent e053a24cfc
commit 6cd89f58bd

View File

@@ -1666,8 +1666,16 @@ endfunction
" s:GetFoldLevel() {{{1
function! s:GetFoldLevel(lnum)
let curindent = len(matchstr(getline(a:lnum)[1:], '^[ ]*[-+#]\?')) / 2
let nextindent = len(matchstr(getline(a:lnum + 1)[1:], '^[ ]*[-+#]\?')) / 2
let curline = getline(a:lnum)
if curline[0] == '"' " Don't fold comments
return 0
endif
let nextline = getline(a:lnum + 1)
let curindent = len(matchstr(curline[1:], '^[ ]*[-+#]\?')) / 2
let nextindent = len(matchstr(nextline[1:], '^[ ]*[-+#]\?')) / 2
if curindent < nextindent
return '>' . (curindent + 1)