Skip to content

Commit 084269b

Browse files
committed
JSON highlighting also & set lint: true if JS/JSON
1 parent b601ea0 commit 084269b

1 file changed

Lines changed: 22 additions & 21 deletions

File tree

processes/on-editor-load.php

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,31 @@
3131
fileExt = fileName.split(".");
3232
fileExt = fileExt[fileExt.length-1];
3333
var mode =
34-
fileExt == "js" ? "text/javascript"
35-
: fileExt == "coffee" ? "text/x-coffeescript"
36-
: fileExt == "rb" ? "text/x-ruby"
37-
: fileExt == "py" ? "text/x-python"
38-
: fileExt == "css" ? "text/css"
39-
: fileExt == "less" ? "text/x-less"
40-
: fileExt == "md" ? "text/x-markdown"
41-
: fileExt == "xml" ? "application/xml"
42-
: fileExt == "sql" ? "text/x-mysql" // also text/x-sql, text/x-mariadb, text/x-cassandra or text/x-plsql
43-
: fileExt == "erl" ? "text/x-erlang"
44-
: fileExt == "yaml" ? "text/x-yaml"
45-
: fileExt == "java" ? "text/x-java"
46-
: fileExt == "jl" ? "text/x-julia"
47-
: fileExt == "c" ? "text/x-csrc"
48-
: fileExt == "cpp" ? "text/x-c++src"
49-
: fileExt == "cs" ? "text/x-csharp"
50-
: fileExt == "go" ? "text/x-go"
51-
: fileExt == "lua" ? "text/x-lua"
52-
: fileExt == "pl" ? "text/x-perl"
53-
: fileExt == "rs" ? "text/x-rustsrc"
54-
: fileExt == "scss" ? "text/x-sass"
34+
fileExt == "js" || fileExt == "json" ? "text/javascript"
35+
: fileExt == "coffee" ? "text/x-coffeescript"
36+
: fileExt == "rb" ? "text/x-ruby"
37+
: fileExt == "py" ? "text/x-python"
38+
: fileExt == "css" ? "text/css"
39+
: fileExt == "less" ? "text/x-less"
40+
: fileExt == "md" ? "text/x-markdown"
41+
: fileExt == "xml" ? "application/xml"
42+
: fileExt == "sql" ? "text/x-mysql" // also text/x-sql, text/x-mariadb, text/x-cassandra or text/x-plsql
43+
: fileExt == "erl" ? "text/x-erlang"
44+
: fileExt == "yaml" ? "text/x-yaml"
45+
: fileExt == "java" ? "text/x-java"
46+
: fileExt == "jl" ? "text/x-julia"
47+
: fileExt == "c" ? "text/x-csrc"
48+
: fileExt == "cpp" ? "text/x-c++src"
49+
: fileExt == "cs" ? "text/x-csharp"
50+
: fileExt == "go" ? "text/x-go"
51+
: fileExt == "lua" ? "text/x-lua"
52+
: fileExt == "pl" ? "text/x-perl"
53+
: fileExt == "rs" ? "text/x-rustsrc"
54+
: fileExt == "scss" ? "text/x-sass"
5555
: "application/x-httpd-php";
5656

5757
cM.setOption("mode",mode);
58+
cM.setOption("lint",(fileExt == "js" || fileExt == "json") && top.ICEcoder.codeAssist ? true : false);
5859
cMdiff.setOption("mode",mode);
5960
}
6061
}

0 commit comments

Comments
 (0)