From c1c1f817c99a8240e987e42bc707ccedb17f206c Mon Sep 17 00:00:00 2001 From: 49lf Date: Wed, 13 Nov 2024 01:10:48 -0500 Subject: [PATCH] ONLY reload current file on changes. --- src/components/FileTree.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/FileTree.tsx b/src/components/FileTree.tsx index 2eecccfc7..b3506df40 100644 --- a/src/components/FileTree.tsx +++ b/src/components/FileTree.tsx @@ -196,8 +196,7 @@ const FileTreeItem = ({ return } - // Don't try to read a file that was removed. - if (isCurrentFile && eventType !== 'unlink') { + if (isCurrentFile && eventType === 'change') { let code = await window.electron.readFile(path, { encoding: 'utf-8' }) code = normalizeLineEndings(code) codeManager.updateCodeStateEditor(code)