diff --git a/readline/comp-group.go b/readline/comp-group.go index ecf59b4..6a6e7bc 100644 --- a/readline/comp-group.go +++ b/readline/comp-group.go @@ -73,6 +73,7 @@ func (g *CompletionGroup) updateTabFind(rl *Instance) { // We perform filter right here, so we create a new completion group, and populate it with our results. for i := range g.Suggestions { + if rl.regexSearch == nil { continue } if rl.regexSearch.MatchString(g.Suggestions[i]) { suggs = append(suggs, g.Suggestions[i]) } else if g.DisplayType == TabDisplayList && rl.regexSearch.MatchString(g.Descriptions[g.Suggestions[i]]) { diff --git a/readline/tabfind.go b/readline/tabfind.go index 5abe307..aa38259 100644 --- a/readline/tabfind.go +++ b/readline/tabfind.go @@ -33,6 +33,7 @@ func (rl *Instance) updateTabFind(r []rune) { var err error rl.regexSearch, err = regexp.Compile("(?i)" + string(rl.tfLine)) if err != nil { + rl.RefreshPromptLog(err.Error()) rl.infoText = []rune(Red("Failed to match search regexp")) }