changed the policy of defining long blocks

This commit is contained in:
Liana Bakradze
2015-11-23 15:54:26 +03:00
parent e0e34283a3
commit 6147fb39c5
3 changed files with 5 additions and 6 deletions

View File

@@ -155,8 +155,7 @@ public class PythonFoldingBuilder extends CustomFoldingBuilder implements DumbAw
}
PsiElement element = statementList.getPsi();
if (element instanceof PyStatementList) {
PyStatementList statements = (PyStatementList)element;
return statements.getStatements().length > 1;
return StringUtil.countNewLines(element.getText()) > 0;
}
return false;
}

View File

@@ -28,10 +28,10 @@ while True:<fold text='...'>
f = open('1.txt')
ints = []
try:
try:<fold text='...'>
for line in f:<fold text='...'>
ints.append(int(line))
ints.append(int(line))</fold>
ints.append(int(line))</fold></fold>
except ValueError:<fold text='...'>
print('')

View File

@@ -16,10 +16,10 @@ class ImportantClass(object):<fold text='...'>
<fold text='VeryImportant'>#region VeryImportant
def importantFunction():<fold text='...'>
if (x > 0):
if (x > 0):<fold text='...'>
<fold text='Body'>#region Body
print "abc"
#endregion</fold>
#endregion</fold></fold>
return</fold>
pass
#endregion</fold>