Skip to content
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

Crash/Hang when Running from Large Directory #93

Open
conor-f opened this issue Jun 10, 2021 · 1 comment
Open

Crash/Hang when Running from Large Directory #93

conor-f opened this issue Jun 10, 2021 · 1 comment

Comments

@conor-f
Copy link

conor-f commented Jun 10, 2021

I opened a file in a distant subdirectory today without cding into it:

cd
vim Code/example-project/src/example-package/file.py

and :AnyJump hung in a way that was difficult to exit. I presume this is because it was running the search from ~/ instead of looking specifically within subdirectories? I imagine there could be some bit of optimization made where it could recursively look in directories back from the current file path. e.g. from the example above, searching in the order:

Code/example-project/src/example-package/*
Code/example-project/src/*
Code/example-project/*
Code/*
*

Combined with a max timeout or similar, this would mitigate the issue I think?

@midrare
Copy link

midrare commented Jul 29, 2022

Alternatively, we could limit the search area to only files in the current buffer's codebase.

We can do this by traveling up the directory tree, starting from %:p:h and ending with /, looking for "project root marker" files, e.g. .git, .svn, .root, _darcs, etc. Then once we find the root directory for the project, recursively search only that directory.

If no root markers are found, then it's not a codebase and shouldn't be searched (or only search the directory containing the file associated to the buffer).

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

No branches or pull requests

2 participants