From 88a599643d45d6cac247829c6ba9bc472543c063 Mon Sep 17 00:00:00 2001 From: Joe Lim <50560759+joelim-work@users.noreply.github.com> Date: Wed, 6 Aug 2025 19:23:40 +1000 Subject: [PATCH] Pass all files for `on-load` hook command (#2077) --- app.go | 8 +++++++- nav.go | 9 --------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app.go b/app.go index fe8f7a9f..62e351f1 100644 --- a/app.go +++ b/app.go @@ -430,7 +430,13 @@ func (app *app) loop() { } app.watchDir(d) - onLoad(app, d.fileNames()) + + paths := []string{} + for _, file := range d.allFiles { + paths = append(paths, file.path) + } + onLoad(app, paths) + app.ui.draw(app.nav) case r := <-app.nav.regChan: app.nav.regCache[r.path] = r diff --git a/nav.go b/nav.go index 3ed07484..b605c6a4 100644 --- a/nav.go +++ b/nav.go @@ -442,15 +442,6 @@ func (dir *dir) name() string { return dir.files[dir.ind].Name() } -func (d *dir) fileNames() []string { - names := []string{} - for _, file := range d.files { - names = append(names, file.path) - } - - return names -} - func (nav *nav) isVisualMode() bool { return nav.init && nav.currDir().visualAnchor != -1 }