From 61b348df126e333d454d3eea457d505ea19bd7e6 Mon Sep 17 00:00:00 2001 From: delphinus Date: Fri, 1 Sep 2023 09:48:42 +0900 Subject: [PATCH] fix: show the main window first Without this, it enumerates candidates at first, so the Telescope window does not appear. Now it shows the window at first, then starts enumeration. --- lua/frecency/async_finder.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/frecency/async_finder.lua b/lua/frecency/async_finder.lua index 7aae334c..c6de2735 100644 --- a/lua/frecency/async_finder.lua +++ b/lua/frecency/async_finder.lua @@ -33,6 +33,8 @@ AsyncFinder.new = function(state, fs, path, entry_maker, initial_results) local tx, rx = async.control.channel.mpsc() self.rx = rx async.run(function() + -- NOTE: return the main thread + async.util.sleep(0) local index = #initial_results local count = 0 for name in fs:scan_dir(path) do