Pass all files for on-load hook command (#2077)

This commit is contained in:
Joe Lim authored and GitHub committed 2025-08-06 19:23:40 +10:00
1 parent 9183e81f7f
commit 88a599643d
2 files changed
+7 -10

No files matched your search

+7 -1
View File
@@ -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
-9
View File
@@ -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
}