Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,15 @@ func (m model) View() string {
s.WriteString(" ")
}

styledOption := m.choices[match.Str]
styledOption, present := m.choices[match.Str]
if !present {
// No styled option found, print the unstyled string instead
// This can happen when --no-strict is used, and we want to print the input as an option
s.WriteString(lineTextStyle.Render(match.Str))
s.WriteRune('\n')
continue
}

if len(match.MatchedIndexes) == 0 {
// No matches, just render the text.
s.WriteString(lineTextStyle.Render(styledOption))
Expand Down