mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 22:22:18 +08:00
parent
8e47088260
commit
91515242d4
@ -59,12 +59,13 @@ const mutations = {
|
||||
window.DIRNAME = pathname ? path.dirname(pathname) : ''
|
||||
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
|
||||
if (Object.keys(fileState).length === 0) {
|
||||
state.listToc = []
|
||||
state.toc = []
|
||||
}
|
||||
}
|
||||
},
|
||||
// Exchange from with to and move from to the end if to is null or empty.
|
||||
EXCHANGE_TABS_BY_ID (state, tabIDs) {
|
||||
@ -252,6 +253,12 @@ const mutations = {
|
||||
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 }) {
|
||||
const { tabs } = state
|
||||
|
Loading…
Reference in New Issue
Block a user