From b2ceca3a8f15e47e6d8197c4cb659d7957ab96e2 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Wed, 29 May 2013 14:49:39 +0100 Subject: [PATCH] Range fix & check fold type by file extension Revert back to the 'from' > 'from' range as we may not always have a 'from' > 'to' object here Determine fold type by filename extension, also includes CSS and LESS --- editor.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor.php b/editor.php index 888a0a3..c419790 100644 --- a/editor.php +++ b/editor.php @@ -214,7 +214,7 @@ function createNewCMInstance(num) { var filepath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]; var filename = filepath.substr(filepath.lastIndexOf("/")+1); var fileExt = filename.substr(filename.lastIndexOf(".")+1); - for (var i=changeObj.from.line; i -1 ? "braceRangeFinder" : "tagRangeFinder"],null,"+","-",true)(thisCM, i); } // Update HTML edited files live @@ -252,7 +252,10 @@ function createNewCMInstance(num) { ); window['cM'+num].on("gutterClick", function(thisCM, line, gutter, clickEvent) { - ["JavaScript","CoffeeScript","PHP","Python","Ruby"].indexOf(top.ICEcoder.caretLocType) > -1 + var filepath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]; + var filename = filepath.substr(filepath.lastIndexOf("/")+1); + var fileExt = filename.substr(filename.lastIndexOf(".")+1); + ["coffee","css","js","less","php","py","rb","ruby"].indexOf(fileExt) > -1 ? codeFoldBrace(window['cM'+num], line) : codeFoldTag(window['cM'+num], line); } );