From 03a76faf4cecb1020607274e12c5c2cdb4748bf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Janis=20Daniel=20Da=CC=88hne?=
 <janis.daehne2@student.uni-halle.de>
Date: Mon, 21 Oct 2019 16:33:43 +0200
Subject: [PATCH] - fixed issue where the simple ace editor sometimes not
 applied the editor settings (e.g. after all data was loaded) - increased
 default editor font size to 13

---
 src/components/codeEditors/aceEditors/simpleAceEditor.tsx     | 4 ++++
 src/constants.ts                                              | 2 +-
 .../reducers/editorSettingsDialog/editorSettingsReducer.ts    | 2 +-
 .../reducers/exerciseEditorSite/getEditorExerciseReducer.ts   | 1 +
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/components/codeEditors/aceEditors/simpleAceEditor.tsx b/src/components/codeEditors/aceEditors/simpleAceEditor.tsx
index d4ae625c..191d2eac 100644
--- a/src/components/codeEditors/aceEditors/simpleAceEditor.tsx
+++ b/src/components/codeEditors/aceEditors/simpleAceEditor.tsx
@@ -208,7 +208,11 @@ class SimpleAceEditor extends React.Component<Props, any> {
         return
       }
 
+      //the session could have changed e.g. when we load the edit exercise site
+      //we first display the initial content (session)
+      //after we loaded the exercise data we create a new session where the settings are not applied yet...
       this.aceEditorWrapper.editor.setSession(wrapperTab.session)
+      this.applyEditorSettingsToTabs()
     }
   }
 
diff --git a/src/constants.ts b/src/constants.ts
index a7b4dc1b..cfcd9b0e 100644
--- a/src/constants.ts
+++ b/src/constants.ts
@@ -13,7 +13,7 @@ import Logger from './helpers/logger'
  * y - breaking changes / new features
  * z - fixes, small changes
  */
-export const versionString = '2.5.3'
+export const versionString = '2.5.4'
 
 
 export const supportMail = 'yapex@informatik.uni-halle.de'
diff --git a/src/state/reducers/editorSettingsDialog/editorSettingsReducer.ts b/src/state/reducers/editorSettingsDialog/editorSettingsReducer.ts
index a75414ac..086d8b5a 100644
--- a/src/state/reducers/editorSettingsDialog/editorSettingsReducer.ts
+++ b/src/state/reducers/editorSettingsDialog/editorSettingsReducer.ts
@@ -13,7 +13,7 @@ export type State = CodeEditorSettingsFullBase
 export const initial: State = {
   id: -1,
   theme: defaultEditorTheme,
-  fontSize: 12,
+  fontSize: 13,
   highlightCurrentLine: true,
   showInvisibles: false,
   showLineNumbers: true,
diff --git a/src/state/reducers/exerciseEditorSite/getEditorExerciseReducer.ts b/src/state/reducers/exerciseEditorSite/getEditorExerciseReducer.ts
index a780215b..a2e9c9c8 100644
--- a/src/state/reducers/exerciseEditorSite/getEditorExerciseReducer.ts
+++ b/src/state/reducers/exerciseEditorSite/getEditorExerciseReducer.ts
@@ -59,6 +59,7 @@ export function reducer(state: State = initial(), action: AllActions): State {
       AceEditorsStorageHelper.removeEditor(editExerciseExerciseDescriptionEditorPanelViewEditorId)
 
       //these ares the same defaults as in the descriptionEditorPanelView (we need the same id)
+      //here the editor settings are not yet applied but we apply them in the componentDidUpdate method of the editor wrapper
       AceEditorsStorageHelper.addEditor(editExerciseExerciseDescriptionEditorPanelViewEditorId, {
         id: 0,
         content: action.payload.exerciseDescription.content,
-- 
GitLab