From 0223187e7620fd1f9573ce483fe2a8aec5b49297 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 21 Jul 2016 11:31:45 -0400 Subject: [PATCH] walk: filter \set keywords correctly When checking if a new set is needed (curSet != nil), curSet wasn't being filtered against the actual keywords a user specifies. Thus, if `defaultSetKeywords` includes "flags", but the `keywords` argument for Walk() doesn't include "flags", "flags" was included in the new \set, which isn't expected behavior. Instead, we want to use keywordSelector function to make sure that we use intended user-specified keywords. Signed-off-by: Stephen Chung --- walk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/walk.go b/walk.go index b6c4577..80ea4ea 100644 --- a/walk.go +++ b/walk.go @@ -106,7 +106,7 @@ func Walk(root string, exlcudes []ExcludeFunc, keywords []string) (*DirectoryHie Name: "/set", Type: SpecialType, Pos: len(creator.DH.Entries), - Keywords: append(defaultSetKeywords, klist...), + Keywords: keywordSelector(append(defaultSetKeywords, klist...), keywords), } creator.curSet = &e creator.DH.Entries = append(creator.DH.Entries, e)