Add on-load command (#2010)

This commit is contained in:
CatsDeservePets authored and GitHub committed 2025-06-20 17:36:57 +10:00
1 parent b76d2546e1
commit ff0c7f1c96
6 files changed
+47 -3

No files matched your search

+9 -1
View File
@@ -43,7 +43,6 @@ type file struct {
func newFile(path string) *file {
lstat, err := os.Lstat(path)
if err != nil {
log.Printf("getting file information: %s", err)
return &file{
@@ -388,6 +387,15 @@ 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 (dir *dir) sel(name string, height int) {
if len(dir.files) == 0 {
dir.ind, dir.pos = 0, 0