Skip to content

feat(filesystem): use fd/find as first level filter in fzy, cancel jobs as needed #800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2023

Conversation

cseickel
Copy link
Contributor

@cseickel cseickel commented Mar 11, 2023

The advantage here is that the fzy search will work in much larger directories because we no longer try to load all of the files and fzy search in memory. Now we will have a first level search using the external program which searches for the existence of all of the characters in the term.

The downside is that it will no longer find matches that are in a different order than what you type. I think that is a reasonable trade off because the old way was only usable in small projects.

If we want to recreate a perfect fzy search, we should just use fzy itself. I think we may be able to use nvim-fzf or at least lean from its code base.

The other change made here is that we now keep track of running jobs for the external find command and kill them when a new one comes in or when the search is exited.

@cseickel cseickel force-pushed the fzy-search-tweaks branch from 0fde78e to 08cc230 Compare March 11, 2023 18:43
@cseickel cseickel merged commit 9e42a88 into main Mar 11, 2023
@cseickel
Copy link
Contributor Author

@pysan3 FYI: I made some changes that will make it work in larger directories without bringing the computer to a grinding halt. You do lose the ability to find results that are out of order, but I think it is a reasonable trade off.

@cseickel cseickel deleted the fzy-search-tweaks branch July 15, 2023 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant