diff --git a/chrome/content/scaffold/monaco/monaco.html b/chrome/content/scaffold/monaco/monaco.html index c8fe052d17..bb22881191 100644 --- a/chrome/content/scaffold/monaco/monaco.html +++ b/chrome/content/scaffold/monaco/monaco.html @@ -62,6 +62,8 @@ detectIndentation: false, ...params }); + + editor.getModel().setEOL(monaco.editor.EndOfLineSequence.LF); window.onresize = function () { editor.layout(); diff --git a/chrome/content/scaffold/scaffold.js b/chrome/content/scaffold/scaffold.js index ae5a11e7e4..1305b58b4c 100644 --- a/chrome/content/scaffold/scaffold.js +++ b/chrome/content/scaffold/scaffold.js @@ -285,7 +285,8 @@ var Scaffold = new function () { // For some reason, even if we explicitly re-set the default model's language to JavaScript, // Monaco still treats it as TypeScript. Recreating the model manually fixes the issue. - editor.setModel(monaco.editor.createModel('', 'javascript', monaco.Uri.parse('inmemory:///translator.js'))); + let model = monaco.editor.createModel('', 'javascript', monaco.Uri.parse('inmemory:///translator.js')); + editor.setModel(model); editor.updateOptions({ lineNumbers: num => num + _linesOfMetadata - 1,