mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 22:22:18 +08:00
parent
8e47088260
commit
91515242d4
@ -59,11 +59,12 @@ const mutations = {
|
|||||||
window.DIRNAME = pathname ? path.dirname(pathname) : ''
|
window.DIRNAME = pathname ? path.dirname(pathname) : ''
|
||||||
bus.$emit('file-changed', { id, markdown, cursor, renderCursor: true, history })
|
bus.$emit('file-changed', { id, markdown, cursor, renderCursor: true, history })
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.tabs.length === 0) {
|
||||||
// Handle close the last tab, need to reset the TOC state
|
// Handle close the last tab, need to reset the TOC state
|
||||||
if (Object.keys(fileState).length === 0) {
|
state.listToc = []
|
||||||
state.listToc = []
|
state.toc = []
|
||||||
state.toc = []
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Exchange from with to and move from to the end if to is null or empty.
|
// Exchange from with to and move from to the end if to is null or empty.
|
||||||
@ -252,6 +253,12 @@ const mutations = {
|
|||||||
bus.$emit('file-changed', { id, markdown, cursor, renderCursor: true, history })
|
bus.$emit('file-changed', { id, markdown, cursor, renderCursor: true, history })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state.tabs.length === 0) {
|
||||||
|
// Handle close the last tab, need to reset the TOC state
|
||||||
|
state.listToc = []
|
||||||
|
state.toc = []
|
||||||
|
}
|
||||||
},
|
},
|
||||||
RENAME_IF_NEEDED (state, { src, dest }) {
|
RENAME_IF_NEEDED (state, { src, dest }) {
|
||||||
const { tabs } = state
|
const { tabs } = state
|
||||||
|
Loading…
Reference in New Issue
Block a user