aboutsummaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/dirlist.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index c84f839..68ba61c 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -161,12 +161,17 @@ func (dirlist *DirectoryList) Prev() {
}
func folderMatches(folder string, pattern string) bool {
- r, err := regexp.Compile(pattern)
- if err != nil {
+ if len(pattern) == 0 {
return false
}
-
- return r.Match([]byte(folder))
+ if pattern[0] == '~' {
+ r, err := regexp.Compile(pattern)
+ if err != nil {
+ return false
+ }
+ return r.Match([]byte(folder))
+ }
+ return pattern == folder
}
// filterDirsByFoldersConfig sets dirlist.dirs to the filtered subset of the