From e6c914481768139c8abaf2491b17ace5b7b37c1a Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 23 Feb 2015 00:54:44 +0000 Subject: [PATCH] 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. --- autoload/pymode/folding.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/pymode/folding.vim b/autoload/pymode/folding.vim index 0ae61dd4..7974112b 100644 --- a/autoload/pymode/folding.vim +++ b/autoload/pymode/folding.vim @@ -50,6 +50,10 @@ fun! pymode#folding#expr(lnum) "{{{ endif if line =~ s:def_regex + " single line def + if indent(a:lnum) >= indent(a:lnum+1) + return '=' + endif " Check if last decorator is before the last def let decorated = 0 let lnum = a:lnum - 1