handle files without extensions when importing into the code editor

This commit is contained in:
ansuz
2019-07-13 10:25:22 +02:00
parent 4156b1988f
commit 8193a1997c
2 changed files with 12 additions and 3 deletions

View File

@@ -363,7 +363,15 @@ define([
});
framework.setFileExporter(CodeMirror.getContentExtension, CodeMirror.fileExporter);
framework.setFileImporter({}, CodeMirror.fileImporter);
framework.setFileImporter({}, function () {
/* setFileImporter currently takes a function with the following signature:
(content, file) => {}
I used 'apply' with 'arguments' to avoid breaking things if this API ever changes.
*/
var ret = CodeMirror.fileImporter.apply(null, Array.prototype.slice.call(arguments));
previewPane.modeChange(ret.mode);
return ret;
});
framework.setNormalizer(function (c) {
return {