Add workaround for equivalent paths for watch option (#1895)

* Add workaround for equivalent paths for watch option

* Add comment

* Simplify path watching
This commit is contained in:
Joe Lim authored and GitHub committed 2025-01-30 09:53:50 +11:00
1 parent 2745c1ab22
commit 7595e05957
3 files changed
+57 -27

No files matched your search

+3 -2
View File
@@ -195,7 +195,9 @@ func (e *setExpr) eval(app *app, args []string) {
if err == nil {
if gOpts.watch {
app.watch.start()
app.addWatchPaths()
for _, dir := range app.nav.dirCache {
app.watchDir(dir)
}
} else {
app.watch.stop()
}
@@ -582,7 +584,6 @@ func preChdir(app *app) {
func onChdir(app *app) {
app.nav.addJumpList()
app.addWatchPaths()
if cmd, ok := gOpts.cmds["on-cd"]; ok {
cmd.eval(app, nil)
}