File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,9 @@ fun! pymode#folding#expr(lnum) "{{{
57
57
return " <" .(indent / &shiftwidth + 1 )
58
58
endif
59
59
60
- " Handle nested defs
61
- if indent (prevnonblank (a: lnum ))
60
+ " Handle nested defs but only for files shorter than
61
+ " g:pymode_folding_nest_limit lines due to performance concerns
62
+ if line (' $' ) < g: pymode_folding_nest_limit && indent (prevnonblank (a: lnum ))
62
63
let curpos = getcurpos ()
63
64
try
64
65
let last_block = s: BlockStart (a: lnum )
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ call pymode#default("g:pymode_indent", 1)
36
36
37
37
" Enable/disable pymode folding for pyfiles.
38
38
call pymode#default (" g:pymode_folding" , 1 )
39
+ " Maximum file length to check for nested class/def statements
40
+ call pymode#default (" g:pymode_folding_nest_limit" , 1000 )
39
41
" Change for folding customization (by example enable fold for 'if', 'for')
40
42
call pymode#default (" g:pymode_folding_regex" , ' ^\s*\%(class\|def\) \w\+' )
41
43
You can’t perform that action at this time.
0 commit comments