Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions plugins/editors/codemirror/layouts/editors/codemirror/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,15 @@
cm.defineInitHook(function (editor)
{
// Try to set up the mode
var mode = cm.findModeByName(editor.options.mode || '');
var mode = cm.findModeByMIME(editor.options.mode || '') ||
cm.findModeByName(editor.options.mode || '') ||
cm.findModeByExtension(editor.options.mode || '');

cm.autoLoadMode(editor, mode ? mode.mode : editor.options.mode);

if (mode)
{
cm.autoLoadMode(editor, mode.mode);
editor.setOption('mode', mode.mime);
}
else
{
cm.autoLoadMode(editor, editor.options.mode);
editor.setOption('mode', mode.mode);
}

// Handle gutter clicks (place or remove a marker).
Expand Down