From 68568043136f7f379c81fb0e3583daf7023d4006 Mon Sep 17 00:00:00 2001 From: Joe Lim <50560759+joelim-work@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:40:33 +1000 Subject: [PATCH] Watch new directory when created --- app.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index 0bf6cdc8..b9d0464e 100644 --- a/app.go +++ b/app.go @@ -645,8 +645,11 @@ func (app *app) updateFile(path string, add bool) { } if add { - if _, err := os.Stat(path); err == nil { + if stat, err := os.Stat(path); err == nil { allFiles = append(allFiles, newFile(path)) + if stat.IsDir() { + app.nav.setWatches() + } } } dir.allFiles = allFiles