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

Nvim-Cmp note [[linking]] completions freeze for 2 seconds on trigger #677

Open
GitMurf opened this issue Aug 9, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@GitMurf
Copy link

GitMurf commented Aug 9, 2024

🐛 Describe the bug

Not sure the best way to report this / ask the question but thought it would be easiest to link to the lines of code. The problem is that nvim-cmp completions are slow for me to load (take 2 seconds each time I trigger a completion with “[[…” for linking to notes.

I traced it down to the search.search_async() call (see below) which got me to thinking, why is [[note linking]] searching the content of all files in my vault?

As you can see below, it first runs the search.search_ansync() and then runs the search.find_async() below it.

When I comment out the search.search_async() (and add one to the cmd counter) everything works as expected and I can [[link to notes…]] quickly and without any delay/pause.

Is this expected to be searching content of notes every time even though I am just trying to link to note names?

client:find_notes_async(search, search_callback, {

Client.find_notes_async = function(self, term, callback, opts)

local next_path = self:_search_iter_async(term, opts.search)

Client._search_iter_async = function(self, term, search_opts, find_opts)

search.search_async(

search.find_async(

Config

Using defaults…

Environment

nvim stable v0.10 (reporting on my phone right now… can provide later if needed but it should be N/A to my reported issue)

@GitMurf GitMurf added the bug Something isn't working label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant