fix race when options are changed while sorting

Related #502
This commit is contained in:
Gokcehan committed 2020-11-18 22:46:59 +03:00
1 parent 8dd4be0ddb
commit c629b3d4ce
3 files changed
+15 -15

No files matched your search

+2 -2
View File
@@ -135,9 +135,9 @@ func isExecutable(f os.FileInfo) bool {
return f.Mode()&0111 != 0
}
func isHidden(f os.FileInfo, path string) bool {
func isHidden(f os.FileInfo, path string, hiddenfiles []string) bool {
hidden := false
for _, pattern := range gOpts.hiddenfiles {
for _, pattern := range hiddenfiles {
matched := matchPattern(strings.TrimPrefix(pattern, "!"), f.Name(), path)
if strings.HasPrefix(pattern, "!") && matched {
hidden = false