Skip to content

Commit 7103ff8

Browse files
committed
fix ace editor mode loading
1 parent daa2d8b commit 7103ff8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/editors/string.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,13 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({
377377
this.ace_editor.setValue(this.getValue());
378378

379379
// The theme
380-
if(JSONEditor.plugins.ace.theme) this.ace_editor.setTheme('ace/theme/'+JSONEditor.plugins.ace.theme);
380+
if(JSONEditor.plugins.ace.theme) {
381+
this.ace_editor.setTheme('ace/theme/'+JSONEditor.plugins.ace.theme);
382+
}
381383
// The mode
382-
mode = window.ace.require("ace/mode/"+mode);
383-
if(mode) this.ace_editor.getSession().setMode(new mode.Mode());
384+
if(mode) {
385+
this.ace_editor.getSession().setMode("ace/mode/"+mode);
386+
}
384387

385388
// Listen for changes
386389
this.ace_editor.on('change',function() {

0 commit comments

Comments
 (0)