From 6fcc047c3116b6ef59cae39b3beb9e815f9b62a6 Mon Sep 17 00:00:00 2001 From: Daniel Xu Date: Mon, 19 Aug 2019 22:10:48 -0700 Subject: [PATCH] Only compile regex portion of folder filter The code was trying to compile the `~` as well. In this case, it was trying to match a literal `~` to the front of the supplied regex. Fixes: 334ca89bea381 ("folder filter: only assume regex if filter is ~fmt") Signed-off-by: Daniel Xu --- widgets/dirlist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/dirlist.go b/widgets/dirlist.go index 68ba61c..6214c8e 100644 --- a/widgets/dirlist.go +++ b/widgets/dirlist.go @@ -165,7 +165,7 @@ func folderMatches(folder string, pattern string) bool { return false } if pattern[0] == '~' { - r, err := regexp.Compile(pattern) + r, err := regexp.Compile(pattern[1:]) if err != nil { return false }