@@ -761,7 +761,6 @@ local function create_debounced_search()
761761 local is_searching = false
762762 --- @type vim.SystemObj | nil
763763 local current_job = nil
764- local pending_search = nil
765764 local search_id = 0
766765 local handled_results = {}
767766
@@ -795,9 +794,11 @@ local function create_debounced_search()
795794 return entry .name
796795 end ):totable ()
797796 local res = vim .fn .matchfuzzypos (names , search_text )
797+ local maxwidth = 0
798798 for _ , entry in ipairs (results ) do
799799 for k , v in ipairs (res [1 ]) do
800800 if v == entry .name then
801+ maxwidth = math.max (maxwidth , api .nvim_strwidth (v ))
801802 entry .match_pos = res [2 ][k ]
802803 entry .score = res [3 ][k ] or 0
803804 table.insert (filters , entry )
@@ -809,7 +810,7 @@ local function create_debounced_search()
809810 table.sort (handled_results , function (a , b )
810811 return a .score > b .score
811812 end )
812- callback (vim .list_slice (handled_results , 1 , 80 ), # handled_results )
813+ callback (vim .list_slice (handled_results , 1 , 80 ), # handled_results , maxwidth )
813814 end
814815
815816 local function execute_search (state , search_text , callback )
@@ -975,8 +976,9 @@ Browser.State = {
975976 return
976977 end
977978 state .entries = {}
978- state .search_engine .search (state , query , function (entries , count )
979+ state .search_engine .search (state , query , function (entries , count , maxwidth )
979980 state .entries = vim .list_extend (state .entries , entries )
981+ state .maxwidth = maxwidth
980982 if count > 100 then
981983 state .count_mark =
982984 api .nvim_buf_set_extmark (new_state .search_buf , ns_id , 0 , 0 , {
0 commit comments