Fix: use CodeMirror.defineExtension

This commit is contained in:
eight 2017-11-01 11:00:41 +08:00
parent 0ad0c70f7c
commit 2b17c07cd6

View File

@ -107,8 +107,8 @@
uso: 'css' uso: 'css'
}; };
CodeMirror.prototype.setPreprocessor = function(preprocessor) { CodeMirror.defineExtension('setPreprocessor', function (preprocessor) {
this.setOption('mode', MODE[preprocessor] || 'css'); this.setOption('mode', MODE[preprocessor] || 'css');
CodeMirror.autoLoadMode(this, MODE[preprocessor] || 'css'); CodeMirror.autoLoadMode(this, MODE[preprocessor] || 'css');
}; });
})(); })();