Created
July 26, 2019 00:56
-
-
Save nantsou/b82e5b7abf11e3c5d08677de0f68fc31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mode_map = { | |
"cpp": "c_cpp", | |
"java": "java", | |
"python":"python", | |
"python3": "python", | |
"bash": "sh", | |
"javascript": "javascript", | |
"css": "css", | |
"html": "html", | |
} | |
function update_code_mode(obj) { | |
var choice_id = obj.id; | |
var editor_id = choice_id.replace("language", "code"); | |
var code_mode = "ace/mode/" + mode_map[obj.value]; | |
var _editor = window.ACEInstances?window.ACEInstances[editor_id]:null; | |
if (_editor) _editor.getSession().setMode(code_mode); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment