Determin fold type by { char existence

Don't assume if it's a certain file type it will be folding on braces,
instead fold on braces if there's a brace char on that line
This commit is contained in:
Matt Pass
2013-06-29 17:25:50 +01:00
parent 846204c244
commit 5b32c96f1d

View File

@@ -367,7 +367,11 @@ if (action=="load") {
top.ICEcoder.nextcMInstance++;
top.ICEcoder.openFileMDTs.push('<?php echo $serverType=="Linux" ? filemtime($file) : "1000000"; ?>');
for (var i=0; i<cM.lineCount(); i++) {
top.ICEcoder.content.contentWindow.CodeMirror.newFoldFunction(top.ICEcoder.content.contentWindow.CodeMirror[["coffee","css","js","less","php","py","rb","ruby"].indexOf('<?php echo pathinfo($file, PATHINFO_EXTENSION);?>') > -1 ? "braceRangeFinder" : "tagRangeFinder"],null,"+","-",true)(cM, i);
top.ICEcoder.content.contentWindow.CodeMirror.newFoldFunction(top.ICEcoder.content.contentWindow.CodeMirror[
cM.getLine(i).indexOf("{")>-1
? "braceRangeFinder"
: "tagRangeFinder"
],null,"+","-",true)(cM, i);
}
top.ICEcoder.loadingFile = false;
<?php