summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/context/file/watcher.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/app/src/context/file/watcher.ts')
-rw-r--r--packages/app/src/context/file/watcher.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/app/src/context/file/watcher.ts b/packages/app/src/context/file/watcher.ts
index a3a98eae4..fbf719927 100644
--- a/packages/app/src/context/file/watcher.ts
+++ b/packages/app/src/context/file/watcher.ts
@@ -8,6 +8,7 @@ type WatcherEvent = {
type WatcherOps = {
normalize: (input: string) => string
hasFile: (path: string) => boolean
+ isOpen?: (path: string) => boolean
loadFile: (path: string) => void
node: (path: string) => FileNode | undefined
isDirLoaded: (path: string) => boolean
@@ -27,7 +28,7 @@ export function invalidateFromWatcher(event: WatcherEvent, ops: WatcherOps) {
if (!path) return
if (path.startsWith(".git/")) return
- if (ops.hasFile(path)) {
+ if (ops.hasFile(path) || ops.isOpen?.(path)) {
ops.loadFile(path)
}