fix: editor font size doesn't change on new tabs, fixes #442

This commit is contained in:
Fabio Di Stasio 2022-09-15 19:03:18 +02:00
parent 498a9b48e2
commit 84168d1d75
1 changed files with 8 additions and 7 deletions

View File

@ -34,6 +34,12 @@ const {
lineWrap
} = storeToRefs(settingsStore);
const sizes = {
small: '12px',
medium: '14px',
large: '16px'
};
const props = defineProps({
modelValue: String,
workspace: Object as Prop<Workspace>,
@ -240,12 +246,6 @@ watch(editorTheme, () => {
});
watch(editorFontSize, () => {
const sizes = {
small: '12px',
medium: '14px',
large: '16px'
};
if (editor.value) {
editor.value.setOptions({
fontSize: sizes[editorFontSize.value]
@ -305,7 +305,8 @@ onMounted(() => {
enableBasicAutocompletion: true,
wrap: lineWrap.value,
enableSnippets: true,
enableLiveAutocompletion: autoComplete.value
enableLiveAutocompletion: autoComplete.value,
fontSize: sizes[editorFontSize.value]
});
if (!baseCompleter.value.length)