diff --git a/src/app.js b/src/app.js index 8fab4021ee..31af703f24 100644 --- a/src/app.js +++ b/src/app.js @@ -455,10 +455,13 @@ var run = function () { function editorOnChange () { var input = editor.getValue() + // save contents + editor.setCacheFileContent(input) + if (input === '') { - editor.setCacheFileContent('') return } + if (input === previousInput) { return } diff --git a/src/app/compiler.js b/src/app/compiler.js index 796e956857..22eb11bd56 100644 --- a/src/app/compiler.js +++ b/src/app/compiler.js @@ -41,7 +41,6 @@ function Compiler (editor, handleGithubCall) { editor.clearAnnotations() self.event.trigger('compilationStarted', []) var input = editor.getValue() - editor.setCacheFileContent(input) var files = {} files[utils.fileNameFromKey(editor.getCacheFile())] = input