Skip to content

Commit 411a74d

Browse files
committed
Setup folding regex
1 parent ade0967 commit 411a74d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

autoload/pymode/folding.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
" Python-mode folding functions
22

33

4+
let s:def_regex = g:pymode_folding_regex
45
let s:blank_regex = '^\s*$'
5-
let s:def_regex = '^\s*\%(class\|def\) \w\+'
66
let s:decorator_regex = '^\s*@'
77
let s:doc_begin_regex = '^\s*\%("""\|''''''\)'
88
let s:doc_end_regex = '\%("""\|''''''\)\s*$'

plugin/pymode.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ call pymode#default("g:pymode_indent", 1)
3232

3333
" Enable/disable pymode folding for pyfiles.
3434
call pymode#default("g:pymode_folding", 1)
35+
" Change for folding customization (by example enable fold for 'if', 'for')
36+
call pymode#default("g:pymode_folding_regex", '^\s*\%(class\|def\) \w\+')
3537

3638
" Enable/disable python motion operators
3739
call pymode#default("g:pymode_motion", 1)

0 commit comments

Comments
 (0)