diff --git a/internal/interactive/interactive.go b/internal/interactive/interactive.go index 01f93a3..b4950a3 100644 --- a/internal/interactive/interactive.go +++ b/internal/interactive/interactive.go @@ -594,7 +594,7 @@ func (m *model) applyFilter() { func (m *model) filteredFiles() (filteredFiles files.Files) { for _, file := range m.files { - if fuzzy.Match(m.filter, file.Name()) { + if isMatch(m.filter, file.Name()) { filteredFiles = append(filteredFiles, file) } else { if _, ok := m.selected[file.String()]; ok { @@ -704,3 +704,9 @@ func makeUnselectedStyle() table.Styles { func styleKey(key key.Binding) string { return fmt.Sprintf("%s %s", darktext.Render(key.Help().Key), darkertext.Render(key.Help().Desc)) } + +func isMatch(pattern, filename string) bool { + p := strings.ToLower(pattern) + f := strings.ToLower(filename) + return fuzzy.Match(p, f) +}