Skip to content

Commit e6c9144

Browse files
committed
Don't fold single line def
Simply checks whether the next line is more indented than the line matching def_regex and if it's not don't increase the fold level.
1 parent 9c8468e commit e6c9144

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

autoload/pymode/folding.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ fun! pymode#folding#expr(lnum) "{{{
5050
endif
5151

5252
if line =~ s:def_regex
53+
" single line def
54+
if indent(a:lnum) >= indent(a:lnum+1)
55+
return '='
56+
endif
5357
" Check if last decorator is before the last def
5458
let decorated = 0
5559
let lnum = a:lnum - 1

0 commit comments

Comments
 (0)