mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 11:44:09 -05:00
@@ -944,7 +944,7 @@ Editor.prototype.onLanguageChange = function (newLangId) {
|
||||
if (newLangId !== this.currentLanguage.id) {
|
||||
var oldLangId = this.currentLanguage.id;
|
||||
this.currentLanguage = languages[newLangId];
|
||||
if (!this.waitingForLanguage) {
|
||||
if (!this.waitingForLanguage && !this.settings.keepSourcesOnLangChange) {
|
||||
this.editorSourceByLang[oldLangId] = this.getSource();
|
||||
this.updateEditorCode();
|
||||
}
|
||||
|
||||
@@ -229,6 +229,7 @@ function setupSettings(root, settings, onChange, subLangId) {
|
||||
add(root.find('.editorsFLigatures'), 'editorsFLigatures', false, Checkbox);
|
||||
add(root.find('.allowStoreCodeDebug'), 'allowStoreCodeDebug', true, Checkbox);
|
||||
add(root.find('.useVim'), 'useVim', false, Checkbox);
|
||||
add(root.find('.keepSourcesOnLangChange'), 'keepSourcesOnLangChange', false, Checkbox);
|
||||
|
||||
setSettings(settings);
|
||||
handleThemes();
|
||||
|
||||
@@ -145,6 +145,10 @@
|
||||
label
|
||||
input.showMinimap(type="checkbox")
|
||||
| Show editor minimap
|
||||
.checkbox
|
||||
label
|
||||
input.keepSourcesOnLangChange(type="checkbox")
|
||||
| Keep editor source on language change
|
||||
div
|
||||
label
|
||||
| Tab width
|
||||
|
||||
Reference in New Issue
Block a user