1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-10-18 23:16:09 +02:00

CodeEditor: attach fontsize setting to monaco

This commit is contained in:
Kushagra Gour
2018-11-23 13:23:26 +05:30
parent 0d97564138
commit 45bf3a0bfb

View File

@@ -66,7 +66,13 @@ 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.updateOptions({ fontSize: prefs.fontSize });
} else {
this.instance.setOption(
'indentWithTabs',
prefs.indentWith !== 'spaces'
);
this.instance.setOption( this.instance.setOption(
'blastCode', 'blastCode',
prefs.isCodeBlastOn ? { effect: 2, shake: false } : false prefs.isCodeBlastOn ? { effect: 2, shake: false } : false
@@ -82,6 +88,7 @@ export default class CodeEditor extends Component {
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
}); });