diff --git a/frontend/src/views/files/Editor.vue b/frontend/src/views/files/Editor.vue index 95867033..f40fa392 100644 --- a/frontend/src/views/files/Editor.vue +++ b/frontend/src/views/files/Editor.vue @@ -4,6 +4,18 @@ {{ fileStore.req?.name ?? "" }} + + {{ fontSize }}px + + (null); +const fontSize = ref(parseInt(localStorage.getItem("editorFontSize") || "14")); const isPreview = ref(false); const previewContent = ref(""); @@ -121,6 +134,7 @@ onMounted(() => { editor.value!.setTheme("ace/theme/twilight"); } + editor.value.setFontSize(fontSize.value); editor.value.focus(); }); @@ -186,6 +200,21 @@ const save = async () => { $showError(e); } }; + +const increaseFontSize = () => { + fontSize.value += 1; + editor.value?.setFontSize(fontSize.value); + localStorage.setItem("editorFontSize", fontSize.value.toString()); +}; + +const decreaseFontSize = () => { + if (fontSize.value > 1) { + fontSize.value -= 1; + editor.value?.setFontSize(fontSize.value); + localStorage.setItem("editorFontSize", fontSize.value.toString()); + } +}; + const close = () => { if (!editor.value?.session.getUndoManager().isClean()) { layoutStore.showHover("discardEditorChanges"); @@ -202,3 +231,10 @@ const preview = () => { isPreview.value = !isPreview.value; }; + +