mirror of https://github.com/Hilbis/Hilbish
fix: print err don't panic and in the case of regex compile failing on menu find
parent
3990d370fa
commit
2faaf4e045
|
@ -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]]) {
|
||||
|
|
|
@ -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"))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue