filter out deleted file - #326
Conversation
|
Nice work! IMO, It may not be done every time, but it should be done once for several times opening frecency. I will think this later again. But I must point out here. telescope-frecency.nvim/lua/frecency/finder.lua Lines 137 to 143 in a3fc66e This process will not be executed “after telescope display is complete”. This code means it removes candidates “at the next loop”. If we want to do this precisely after showing candidates, we should do after here. Can you move this logic after |
It's a bit subtle, there are two filters actually, one to decide if adding to UI, here: and the one you pointed out was to if remove from db. I do think the following line the check_existence in this context is redundant, as if check_existence is false, #deleted_files has to be 0. do I need to worry about the nightly failure in Ubuntu latest? I don't have a ubuntu... |
When files are deleted, they are stuck in the DB and still show up in telescope. This change fixed that by tracking if a file exists before displaying it, and asynchronously removing all selectable but deleted files from the database later. This might cause performance issues, but on my Apple M4 Max, even running
require('telescope').extensions.frecency.frecency({ workspace = "CWD" })on home directory with 64K recursive files, it seems to run smoothly. Nonetheless, I added a flag to disable this behavior if needed.