Skip to content

Commit d9ff147

Browse files
committed
fix(editor): refresh CodeMirror after reload
1 parent ceef0dd commit d9ff147

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/renderer/components/editor/Editor.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,21 @@ async function init() {
269269
},
270270
)
271271
272+
watch(
273+
isShowEditor,
274+
(isVisible, wasVisible) => {
275+
if (!isVisible || wasVisible !== false)
276+
return
277+
278+
nextTick(() => {
279+
requestAnimationFrame(() => {
280+
editor?.refresh()
281+
})
282+
})
283+
},
284+
{ flush: 'post' },
285+
)
286+
272287
watch(searchQuery, () => {
273288
nextTick(() => {
274289
updateSearchOverlay()

0 commit comments

Comments
 (0)