mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-02 23:03:59 +01:00
className gone, need to use type
className dropped by CodeMirror, need to pick up "error" from type As it may not be there, we need to test for its existence and it's also be part of a string eg "tag brackets error", so indexOf is needed
This commit is contained in:
@@ -134,13 +134,14 @@ top.ICEcoder.getNestLocationSub = function(nestCheck, fileName) {
|
||||
|
||||
// Indicate if the nesting structure of the code is OK
|
||||
top.ICEcoder.updateNestingIndicator = function() {
|
||||
var cM, nestOK, fileName;
|
||||
var cM, testToken, nestOK, fileName;
|
||||
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
nestOK = true;
|
||||
fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||
if (cM && fileName && ["js","coffee","css","less","sql","erl","yaml","java","jl","c","cpp","cs","go","lua","pl","rs","scss"].indexOf(fileName.split(".")[1])==-1) {
|
||||
nestOK = cM.getTokenAt({line:cM.lineCount(),ch:cM.lineInfo(cM.lineCount()-1).text.length}).className != "error" ? true : false;
|
||||
testToken = cM.getTokenAt({line:cM.lineCount(),ch:cM.lineInfo(cM.lineCount()-1).text.length});
|
||||
nestOK = testToken.type && testToken.type.indexOf("error") == -1 ? true : false;
|
||||
}
|
||||
top.ICEcoder.nestValid.style.background = nestOK ? "#0b0" : "#f00";
|
||||
top.ICEcoder.nestValid.title = nestOK ? "Nesting OK" : "Nesting Broken";
|
||||
|
||||
Reference in New Issue
Block a user