Skip to content

Commit

Permalink
chore: add sleep to show results at first
Browse files Browse the repository at this point in the history
  • Loading branch information
delphinus committed Sep 10, 2023
1 parent a165b57 commit 4e6c81f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/frecency/finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Finder.new = function(database, entry_maker, fs, need_scandir, path, recency, st
local tx, rx = async.control.channel.mpsc()
self.rx = rx
async.run(function()
-- NOTE: return to the main loop
-- NOTE: return to the main loop to show the main window
async.util.sleep(0)
local seen = {}
for i, file in ipairs(self:get_results(path, datetime)) do
Expand All @@ -53,6 +53,8 @@ Finder.new = function(database, entry_maker, fs, need_scandir, path, recency, st
table.insert(self.entries, entry)
tx.send(entry)
end
-- NOTE: return to the main loop to show results from DB
async.util.sleep(self.config.sleep_interval)
if need_scandir and path then
local count = 0
local index = #self.entries
Expand Down

0 comments on commit 4e6c81f

Please sign in to comment.