summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/dirlist.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index b0807ae..c84f839 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -2,6 +2,7 @@ package widgets
 
 import (
 	"log"
+	"regexp"
 	"sort"
 
 	"github.com/gdamore/tcell"
@@ -159,6 +160,15 @@ func (dirlist *DirectoryList) Prev() {
 	dirlist.NextPrev(-1)
 }
 
+func folderMatches(folder string, pattern string) bool {
+	r, err := regexp.Compile(pattern)
+	if err != nil {
+		return false
+	}
+
+	return r.Match([]byte(folder))
+}
+
 // filterDirsByFoldersConfig sets dirlist.dirs to the filtered subset of the
 // dirstore, based on the AccountConfig.Folders option
 func (dirlist *DirectoryList) filterDirsByFoldersConfig() {
@@ -170,7 +180,7 @@ func (dirlist *DirectoryList) filterDirsByFoldersConfig() {
 	var filtered []string
 	for _, folder := range dirlist.dirs {
 		for _, cfgfolder := range dirlist.acctConf.Folders {
-			if folder == cfgfolder {
+			if folderMatches(folder, cfgfolder) {
 				filtered = append(filtered, folder)
 				break
 			}
53aaf'>be3fb4e1 ^
ad601041 ^

be3fb4e1 ^
7feea75b ^





c1041a26 ^
7feea75b ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34