1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-07 01:09:45 +02:00

update dependencies

This commit is contained in:
Dawid Dziurla
2019-12-13 11:29:12 +01:00
parent 3074ae99ea
commit be8f589c32
185 changed files with 45125 additions and 44833 deletions

View File

@ -155,7 +155,8 @@ var defaultUnionMergeDirsFn = func(lofi, bofi []os.FileInfo) ([]os.FileInfo, err
}
// Readdir will weave the two directories together and
// return a single view of the overlayed directories
// return a single view of the overlayed directories.
// At the end of the directory view, the error is io.EOF if c > 0.
func (f *UnionFile) Readdir(c int) (ofi []os.FileInfo, err error) {
var merge DirsMerger = f.Merger
if merge == nil {
@ -185,9 +186,23 @@ func (f *UnionFile) Readdir(c int) (ofi []os.FileInfo, err error) {
}
f.files = append(f.files, merged...)
}
if c == -1 {
if c <= 0 && len(f.files) == 0 {
return f.files, nil
}
if f.off >= len(f.files) {
return nil, io.EOF
}
if c <= 0 {
return f.files[f.off:], nil
}
if c > len(f.files) {
c = len(f.files)
}
defer func() { f.off += c }()
return f.files[f.off:c], nil
}