fix: Fixed the issue of switching file highlighting (#8783)

This commit is contained in:
2025-05-22 16:41:59 +08:00 committed by GitHub
parent 6bd9bb7c06
commit aa8277dc03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -606,6 +606,7 @@ const removeOtherTab = (targetPath: string) => {
}; };
const changeTab = (targetPath: TabPaneName) => { const changeTab = (targetPath: TabPaneName) => {
selectTab.value = targetPath.toString();
getContent(targetPath.toString(), ''); getContent(targetPath.toString(), '');
}; };
@ -958,6 +959,9 @@ const getContent = (path: string, extension: string) => {
saveContent(); saveContent();
fetchFileContent(); fetchFileContent();
}) })
.catch(() => {
selectTab.value = form.value.path;
})
.finally(() => {}); .finally(() => {});
} else { } else {
fetchFileContent(); fetchFileContent();