parent
cf79726d21
commit
88749a3da1
5
nav.go
5
nav.go
@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -112,6 +113,7 @@ type dir struct {
|
||||
files []*file // displayed files in directory including or excluding hidden ones
|
||||
allFiles []*file // all files in directory including hidden ones (same array as files)
|
||||
sortType sortType // sort method and options from last sort
|
||||
hiddenfiles []string // hiddenfiles value from last sort
|
||||
noPerm bool // whether lf has no permission to open the directory
|
||||
}
|
||||
|
||||
@ -134,6 +136,7 @@ func newDir(path string) *dir {
|
||||
|
||||
func (dir *dir) sort() {
|
||||
dir.sortType = gOpts.sortType
|
||||
dir.hiddenfiles = gOpts.hiddenfiles
|
||||
|
||||
dir.files = dir.allFiles
|
||||
|
||||
@ -318,7 +321,7 @@ func (nav *nav) checkDir(dir *dir) {
|
||||
nd.sort()
|
||||
nav.dirChan <- nd
|
||||
}()
|
||||
case dir.sortType != gOpts.sortType:
|
||||
case dir.sortType != gOpts.sortType || !reflect.DeepEqual(dir.hiddenfiles, gOpts.hiddenfiles):
|
||||
dir.loading = true
|
||||
go func() {
|
||||
dir.sort()
|
||||
|
Loading…
Reference in New Issue
Block a user