1 parent
85aa3b9dc6
commit
f01fab6257
1 file changed
+4
-3
@@ -280,6 +280,9 @@ func (dir *dir) sort() {
|
|||||||
dir.files = dir.files[len(dir.files):]
|
dir.files = dir.files[len(dir.files):]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dir.ind = max(dir.ind, 0)
|
||||||
|
dir.ind = min(dir.ind, len(dir.files)-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dir *dir) name() string {
|
func (dir *dir) name() string {
|
||||||
@@ -287,9 +290,6 @@ func (dir *dir) name() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
dir.ind = max(dir.ind, 0)
|
|
||||||
dir.ind = min(dir.ind, len(dir.files)-1)
|
|
||||||
|
|
||||||
return dir.files[dir.ind].Name()
|
return dir.files[dir.ind].Name()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1414,6 +1414,7 @@ func (nav *nav) currFile() (*file, error) {
|
|||||||
if len(dir.files) == 0 {
|
if len(dir.files) == 0 {
|
||||||
return nil, fmt.Errorf("empty directory")
|
return nil, fmt.Errorf("empty directory")
|
||||||
}
|
}
|
||||||
|
|
||||||
return dir.files[dir.ind], nil
|
return dir.files[dir.ind], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user