Add C, C++, Objective-C and Java to the list of languages in the code app
parent
b4aae68c0c
commit
6fa7b147e9
|
@ -10,6 +10,8 @@ define([
|
|||
"ASN.1 asn.1",
|
||||
"Asterisk asterisk",
|
||||
"Brainfuck brainfuck .b",
|
||||
"C text/x-csrc .c",
|
||||
"C text/x-c++src .cpp",
|
||||
"C-like clike",
|
||||
"Clojure clojure",
|
||||
"CMake cmake",
|
||||
|
@ -48,6 +50,7 @@ define([
|
|||
"HTTP http",
|
||||
"IDL idl",
|
||||
"JADE jade",
|
||||
"Java text/x-java .java",
|
||||
"JavaScript javascript .js",
|
||||
"Jinja2 jinja2",
|
||||
"JSX jsx .jsx",
|
||||
|
@ -65,6 +68,7 @@ define([
|
|||
"Nginx nginx",
|
||||
"NSIS nsis",
|
||||
"N-Triples ntriples",
|
||||
"Objective-C text/x-objectivec .m",
|
||||
"Octave octave",
|
||||
"Org-mode orgmode .org",
|
||||
"Oz oz",
|
||||
|
|
|
@ -154,10 +154,15 @@ define([
|
|||
var setMode = exp.setMode = function (mode, cb) {
|
||||
exp.highlightMode = mode;
|
||||
if (mode === 'markdown') { mode = 'gfm'; }
|
||||
if (mode !== "text") {
|
||||
CMeditor.autoLoadMode(editor, mode);
|
||||
if (/text\/x/.test(mode)) {
|
||||
CMeditor.autoLoadMode(editor, 'clike');
|
||||
editor.setOption('mode', mode);
|
||||
} else {
|
||||
if (mode !== "text") {
|
||||
CMeditor.autoLoadMode(editor, mode);
|
||||
}
|
||||
editor.setOption('mode', mode);
|
||||
}
|
||||
editor.setOption('mode', mode);
|
||||
if (exp.$language) {
|
||||
var name = exp.$language.find('a[data-value="' + mode + '"]').text() || undefined;
|
||||
name = name ? Messages.languageButton + ' ('+name+')' : Messages.languageButton;
|
||||
|
|
Loading…
Reference in New Issue