8ed6d065 by astaxie

fix the regexps bugs

1 parent b5a2347e
Showing 1 changed file with 5 additions and 1 deletions
...@@ -106,7 +106,11 @@ func filterTreeWithPrefix(t *Tree, wildcards []string, reg string) { ...@@ -106,7 +106,11 @@ func filterTreeWithPrefix(t *Tree, wildcards []string, reg string) {
106 filterCards = append(filterCards, v) 106 filterCards = append(filterCards, v)
107 } 107 }
108 l.wildcards = filterCards 108 l.wildcards = filterCards
109 l.regexps = regexp.MustCompile("^" + reg + strings.Trim(l.regexps.String(), "^$") + "$") 109 if l.regexps != nil {
110 l.regexps = regexp.MustCompile("^" + reg + strings.Trim(l.regexps.String(), "^$") + "$")
111 } else {
112 l.regexps = regexp.MustCompile("^" + reg + "$")
113 }
110 } else { 114 } else {
111 if l.regexps != nil { 115 if l.regexps != nil {
112 filterCards := []string{} 116 filterCards := []string{}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!