From aa8277dc0380b9fdc9a1ea6ece5b9b35a4d3076e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Thu, 22 May 2025 16:41:59 +0800 Subject: [PATCH] fix: Fixed the issue of switching file highlighting (#8783) --- frontend/src/views/host/file-management/code-editor/index.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/views/host/file-management/code-editor/index.vue b/frontend/src/views/host/file-management/code-editor/index.vue index ab9224fb7..5614caf32 100644 --- a/frontend/src/views/host/file-management/code-editor/index.vue +++ b/frontend/src/views/host/file-management/code-editor/index.vue @@ -606,6 +606,7 @@ const removeOtherTab = (targetPath: string) => { }; const changeTab = (targetPath: TabPaneName) => { + selectTab.value = targetPath.toString(); getContent(targetPath.toString(), ''); }; @@ -958,6 +959,9 @@ const getContent = (path: string, extension: string) => { saveContent(); fetchFileContent(); }) + .catch(() => { + selectTab.value = form.value.path; + }) .finally(() => {}); } else { fetchFileContent();