@@ -4,7 +4,8 @@ local fzy = require("picker.matchers.fzy")
44
55--- @param input string
66--- @param source PickerSource
7- function M .filter (input , source )
7+ --- @param ignorecase boolean
8+ function M .filter (input , source , ignorecase )
89 if # input == 0 then
910 local i = 1
1011 source .filter_items = vim .tbl_map (function (t )
@@ -15,19 +16,19 @@ function M.filter(input, source)
1516 if
1617 source .state .previous_input
1718 and # source .state .previous_input > 0
18- and fzy .has_match (source .state .previous_input , input )
19+ and fzy .has_match (source .state .previous_input , input , ignorecase )
1920 then
2021 local rst = {}
2122 for _ , v in ipairs (source .filter_items ) do
22- if fzy .has_match (input , v [4 ].str ) then
23- local p , s = fzy .positions (input , v [4 ].str )
23+ if fzy .has_match (input , v [4 ].str , ignorecase ) then
24+ local p , s = fzy .positions (input , v [4 ].str , ignorecase )
2425 table.insert (rst , { _ , p , s , v [4 ] })
2526 end
2627 end
2728 if source .state .filter_count < # source .state .items then
2829 for i = source .state .filter_count , # source .state .items do
29- if fzy .has_match (input , source .state .items [i ].str ) then
30- local p , s = fzy .positions (input , source .state .items [i ].str )
30+ if fzy .has_match (input , source .state .items [i ].str , ignorecase ) then
31+ local p , s = fzy .positions (input , source .state .items [i ].str , ignorecase )
3132 table.insert (rst , { _ , p , s , source .state .items [i ] })
3233 end
3334 end
@@ -36,8 +37,8 @@ function M.filter(input, source)
3637 else
3738 local rst = {}
3839 for i = 1 , # source .state .items do
39- if fzy .has_match (input , source .state .items [i ].str ) then
40- local p , s = fzy .positions (input , source .state .items [i ].str )
40+ if fzy .has_match (input , source .state .items [i ].str , ignorecase ) then
41+ local p , s = fzy .positions (input , source .state .items [i ].str , ignorecase )
4142 table.insert (rst , { _ , p , s , source .state .items [i ] })
4243 end
4344 end
0 commit comments