From 6e2c1df24593b42419768efb5f9670eeb77f6e18 Mon Sep 17 00:00:00 2001 From: JINNOUCHI Yasushi Date: Mon, 1 Jan 2024 02:10:50 +0900 Subject: [PATCH] fix: add hack for showing entries immediately (#160) --- lua/frecency/finder.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/frecency/finder.lua b/lua/frecency/finder.lua index 7d3dbef..313d269 100644 --- a/lua/frecency/finder.lua +++ b/lua/frecency/finder.lua @@ -189,6 +189,8 @@ function Finder:find(_, process_result, process_complete) end self.need_scan_db = false end + -- HACK: This is needed for heavy workspaces to show up entries immediately. + async.util.scheduler() if self:process_table(process_result, self.scanned_entries) then return end @@ -219,6 +221,8 @@ end ---@param start_index integer? ---@return boolean? function Finder:process_channel(process_result, entries, rx, start_index) + -- HACK: This is needed for small workspaces that it shows up entries fast. + async.util.sleep(self.config.sleep_interval) local index = #entries > 0 and entries[#entries].index or start_index or 0 local count = 0 while true do