aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/aerc-config.5.scd2
-rw-r--r--widgets/dirlist.go13
2 files changed, 10 insertions, 5 deletions
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index 690b49a..f0b9b7a 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -226,7 +226,7 @@ Note that many of these configuration options are written for you, such as
*folders*
Specifies the comma separated list of folders to display in the sidebar.
- Supports regex patterns.
+ Names prefixed with ~ are interpreted as regular expressions.
Default: all folders
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