mirror of
https://github.com/chinchang/web-maker.git
synced 2025-06-29 11:13:16 +02:00
CodeEditor: attach fontsize setting to monaco
This commit is contained in:
@ -66,21 +66,28 @@ export default class CodeEditor extends Component {
|
|||||||
if (nextProps.prefs !== this.props.prefs) {
|
if (nextProps.prefs !== this.props.prefs) {
|
||||||
const { prefs } = nextProps;
|
const { prefs } = nextProps;
|
||||||
|
|
||||||
this.instance.setOption('indentWithTabs', prefs.indentWith !== 'spaces');
|
if (this.props.mode === 'monaco') {
|
||||||
this.instance.setOption(
|
this.instance.updateOptions({ fontSize: prefs.fontSize });
|
||||||
'blastCode',
|
} else {
|
||||||
prefs.isCodeBlastOn ? { effect: 2, shake: false } : false
|
this.instance.setOption(
|
||||||
);
|
'indentWithTabs',
|
||||||
this.instance.setOption('theme', prefs.editorTheme);
|
prefs.indentWith !== 'spaces'
|
||||||
|
);
|
||||||
|
this.instance.setOption(
|
||||||
|
'blastCode',
|
||||||
|
prefs.isCodeBlastOn ? { effect: 2, shake: false } : false
|
||||||
|
);
|
||||||
|
this.instance.setOption('theme', prefs.editorTheme);
|
||||||
|
|
||||||
this.instance.setOption('indentUnit', +prefs.indentSize);
|
this.instance.setOption('indentUnit', +prefs.indentSize);
|
||||||
this.instance.setOption('tabSize', +prefs.indentSize);
|
this.instance.setOption('tabSize', +prefs.indentSize);
|
||||||
|
|
||||||
this.instance.setOption('keyMap', prefs.keymap);
|
this.instance.setOption('keyMap', prefs.keymap);
|
||||||
this.instance.setOption('lineWrapping', prefs.lineWrap);
|
this.instance.setOption('lineWrapping', prefs.lineWrap);
|
||||||
this.instance.setOption('lineWrapping', prefs.autoCloseTags);
|
this.instance.setOption('lineWrapping', prefs.autoCloseTags);
|
||||||
|
|
||||||
this.instance.refresh();
|
this.instance.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -129,6 +136,7 @@ export default class CodeEditor extends Component {
|
|||||||
enabled: false
|
enabled: false
|
||||||
},
|
},
|
||||||
wordWrap: 'on',
|
wordWrap: 'on',
|
||||||
|
renderWhitespace: 'all',
|
||||||
fontLigatures: true,
|
fontLigatures: true,
|
||||||
automaticLayout: true
|
automaticLayout: true
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user