Compare commits

..

2 Commits

Author SHA1 Message Date
Lykin 3c7003291c
Merge pull request #129 from kt286/realtime-editor-config
feat: update editor config realtime
2024-01-23 11:46:17 +08:00
Cloud 94d642c4de feat: modify editor config realtime 2024-01-22 16:45:30 +08:00
1 changed files with 44 additions and 0 deletions

View File

@ -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(() => { onUnmounted(() => {
destroyEditor() destroyEditor()
}) })