File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,12 @@ import {
9
9
PanelService ,
10
10
SettingsService ,
11
11
} from 'mo/services' ;
12
- import { SettingsEvent , BuiltInSettingsTab } from 'mo/model/settings' ;
12
+ import {
13
+ SettingsEvent ,
14
+ BuiltInSettingsTab ,
15
+ initialEditorSetting ,
16
+ initialWorkbenchSetting ,
17
+ } from 'mo/model/settings' ;
13
18
14
19
export interface ISettingsController { }
15
20
@@ -37,6 +42,11 @@ export class SettingsController
37
42
const config = this . settingsService . normalizeFlatObject (
38
43
tab . data ?. value || ''
39
44
) ;
45
+ config . editor = { ...initialEditorSetting , ...config . editor } ;
46
+ config . workbench = {
47
+ ...initialWorkbenchSetting ,
48
+ ...config . workbench ,
49
+ } ;
40
50
this . settingsService . update ( config ) ;
41
51
}
42
52
} ) ;
Original file line number Diff line number Diff line change @@ -17,11 +17,11 @@ export enum SettingsEvent {
17
17
OnChange = 'settings.onchange' ,
18
18
}
19
19
20
- const initialWorkbenchSetting = {
20
+ export const initialWorkbenchSetting = {
21
21
colorTheme : 'Default Dark+' ,
22
22
} ;
23
23
24
- const initialEditorSetting : IEditorSettings = {
24
+ export const initialEditorSetting : IEditorSettings = {
25
25
renderWhitespace : 'none' ,
26
26
tabSize : 4 ,
27
27
fontSize : 14 ,
@@ -47,8 +47,8 @@ export class SettingsModel implements ISettings {
47
47
editor : IEditorSettings ;
48
48
49
49
constructor (
50
- workbench : IWorkbenchSettings = initialWorkbenchSetting ,
51
- editor : IEditorSettings = initialEditorSetting
50
+ workbench : IWorkbenchSettings = { ... initialWorkbenchSetting } ,
51
+ editor : IEditorSettings = { ... initialEditorSetting }
52
52
) {
53
53
this . workbench = workbench ;
54
54
this . editor = editor ;
You can’t perform that action at this time.
0 commit comments