Skip to content

Commit

Permalink
Merge pull request tiny-craft#129 from kt286/realtime-editor-config
Browse files Browse the repository at this point in the history
feat: update editor config realtime
  • Loading branch information
tiny-craft authored Jan 23, 2024
2 parents ff2043c + 94d642c commit 3c70032
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions frontend/src/components/content_value/ContentEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,50 @@ watch(
},
)
watch(
() => pref.editorFont.fontSize,
(fontSize) => {
if (editorNode != null) {
editorNode.updateOptions({
fontSize,
})
}
},
)
watch(
() => pref.editorFont.fontFamily,
(fontFamily = undefined) => {
if (editorNode != null) {
editorNode.updateOptions({
fontFamily,
})
}
},
)
watch(
() => pref.showLineNum,
(showLineNum) => {
if (editorNode != null) {
editorNode.updateOptions({
lineNumbers: showLineNum ? 'on' : 'off',
})
}
},
)
watch(
() => pref.showFolding,
(showFolding) => {
if (editorNode != null) {
editorNode.updateOptions({
folding: showFolding !== false,
})
}
},
)
onUnmounted(() => {
destroyEditor()
})
Expand Down

0 comments on commit 3c70032

Please sign in to comment.