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) "{{{
5757 return " <" .(indent / &shiftwidth + 1 )
5858 endif
5959
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 ))
6263 let curpos = getcurpos ()
6364 try
6465 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)
3636
3737" Enable/disable pymode folding for pyfiles.
3838call 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 )
3941" Change for folding customization (by example enable fold for 'if', 'for')
4042call pymode#default (" g:pymode_folding_regex" , ' ^\s*\%(class\|def\) \w\+' )
4143
You can’t perform that action at this time.
0 commit comments