@@ -365,6 +365,7 @@ function Picker:find()
365365
366366 local status_updater = self :get_status_updater (prompt_win , prompt_bufnr )
367367 local debounced_status = debounce .throttle_leading (status_updater , 50 )
368+ -- local debounced_status = status_updater
368369
369370 local tx , rx = channel .mpsc ()
370371 self .__on_lines = tx .send
@@ -829,11 +830,6 @@ function Picker:_reset_track()
829830
830831 self .stats .filtered = 0
831832 self .stats .highlights = 0
832-
833- self .stats ._sort_time = 0
834- self .stats ._add_time = 0
835- self .stats ._highlight_time = 0
836- self .stats ._start = vim .loop .hrtime ()
837833end
838834
839835function Picker :_track (key , func , ...)
@@ -912,11 +908,15 @@ end
912908
913909
914910function Picker :get_result_processor (find_id , prompt , status_updater )
915- local score_cb = function (score , entry )
911+ local cb_add = function (score , entry )
916912 self .manager :add_entry (self , score , entry )
917913 status_updater ()
918914 end
919915
916+ local cb_filter = function (_ )
917+ self :_increment (" filtered" )
918+ end
919+
920920 return function (entry )
921921 if find_id ~= self ._find_id
922922 or self .closed
@@ -944,33 +944,7 @@ function Picker:get_result_processor(find_id, prompt, status_updater)
944944 end
945945 end
946946
947- self .sorter :score (prompt , entry , score_cb )
948-
949- -- local sort_ok
950- -- local sort_score = 0
951-
952- -- if self.sorter then
953- -- sort_ok, sort_score = self:_track("_sort_time", pcall, self.sorter.score, self.sorter, prompt, entry)
954-
955- -- if not sort_ok then
956- -- log.warn("Sorting failed with:", prompt, entry, sort_score)
957- -- return
958- -- end
959-
960- -- if entry.ignore_count ~= nil and entry.ignore_count == true then
961- -- self:_decrement("processed")
962- -- end
963-
964- -- if sort_score == -1 then
965- -- self:_increment("filtered")
966- -- log.trace("Filtering out result: ", entry)
967- -- return
968- -- end
969- -- end
970-
971- -- self:_track("_add_time", self.manager.add_entry, self.manager, self, sort_score, entry)
972-
973- -- status_updater()
947+ self .sorter :score (prompt , entry , cb_add , cb_filter )
974948 end
975949end
976950
@@ -1016,17 +990,6 @@ function Picker:get_result_completor(results_bufnr, find_id, prompt, status_upda
1016990 self :clear_extra_rows (results_bufnr )
1017991 self :highlight_displayed_rows (results_bufnr , prompt )
1018992
1019- -- TODO: Cleanup.
1020- self .stats ._done = vim .loop .hrtime ()
1021- self .stats .time = (self .stats ._done - self .stats ._start ) / 1e9
1022-
1023- local function do_times (key )
1024- self .stats [key ] = self .stats [" _" .. key ] / 1e9
1025- end
1026-
1027- do_times (" sort_time" )
1028- do_times (" add_time" )
1029- do_times (" highlight_time" )
1030993
1031994 self :_on_complete ()
1032995
0 commit comments