diff options
-rw-r--r-- | static/compiler.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/static/compiler.js b/static/compiler.js index a4fe29c58..80f2d16ee 100644 --- a/static/compiler.js +++ b/static/compiler.js @@ -76,7 +76,7 @@ define(function (require) { this.originalCompilerId = state.compiler; this.compiler = this.compilerService.findCompiler(this.currentLangId, this.originalCompilerId) || this.compilerService.findCompiler(this.currentLangId, options.defaultCompiler[this.currentLangId]); - this.selectedCompilerByLang = {}; + this.infoByLang = {}; this.deferCompiles = hub.deferred; this.needsCompile = false; this.options = state.options || options.compileOptions[this.currentLangId]; @@ -1145,8 +1145,11 @@ define(function (require) { if (this.sourceEditorId === editorId) { var oldLangId = this.currentLangId; this.currentLangId = newLangId; - // Store the current selected compiler to come back to it later in the same session (Not state sotred!) - this.selectedCompilerByLang[oldLangId] = this.compiler ? this.compiler.id : options.defaultCompiler[oldLangId]; + // Store the current selected stuff to come back to it later in the same session (Not state stored!) + this.infoByLang[oldLangId] = { + compiler: this.compiler && this.compiler.id ? this.compiler.id : options.defaultCompiler[oldLangId], + options: this.options + }; this.updateCompilersSelector(); this.updateLibsDropdown(); } @@ -1174,8 +1177,9 @@ define(function (require) { // Return the first, or an empty string if none found (Should prob report this one...) return value && value.id ? value.id : ""; }, this); - - selector.setValue([this.selectedCompilerByLang[this.currentLangId] || defaultOrFirst()]); + var info = this.infoByLang[this.currentLangId] || {}; + selector.setValue([info.compiler || defaultOrFirst()]); + this.optionsField.val(info.options || ""); }; Compiler.prototype.findCompiler = function (langId, compilerId) { |