Skip to content

Buffer source with lua fuzzy implementation only shows a few candidiates. #1789

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

Closed
2 tasks done
oabt opened this issue May 19, 2025 · 6 comments · Fixed by #1790
Closed
2 tasks done

Buffer source with lua fuzzy implementation only shows a few candidiates. #1789

oabt opened this issue May 19, 2025 · 6 comments · Fixed by #1790
Labels
bug Something isn't working

Comments

@oabt
Copy link

oabt commented May 19, 2025

Make sure you have done the following

  • Updated to the latest version of blink.cmp
  • Searched for existing issues and documentation (try <C-k> on https://cmp.saghen.dev)

Bug Description

When many visible buffers are opened, #buf_text in blink/cmp/sources/buffer.lua may exceed 20000 but less than 500000.

After #1735 the run_async_lua can only show very few candidates for buffer source completion.
It works fine before #1735.

Relevant configuration

neovim version

NVIM v0.11.0 Build type: Release LuaJIT 2.1.1741730670 Run "nvim -V1 -v" for more info

blink.cmp version

main

@oabt oabt added the bug Something isn't working label May 19, 2025
@oabt
Copy link
Author

oabt commented May 19, 2025

Image

Here I disable the LSP source.
When typing "add", only few candidates are listed and "addToReadyList" which I expect is not shown.
It works well before #1735

@oabt
Copy link
Author

oabt commented May 19, 2025

Image

As a comparison, this is the behavior before #1735 with same configs.

@soifou
Copy link
Collaborator

soifou commented May 19, 2025

Oops my fault! Can you try the PR mentionned above (using branch = 'fix/buffer-dedup') and let me know if this resolved your issue?

Saghen pushed a commit that referenced this issue May 19, 2025
@oabt
Copy link
Author

oabt commented May 20, 2025

Oops my fault! Can you try the PR mentionned above (using branch = 'fix/buffer-dedup') and let me know if this resolved your issue?

Yes, it works.
Thank you!

BTW, is it possible to configure the #buf_text limit 20000 and 500000 through require('blink.cmp').setup ?

@Saghen
Copy link
Owner

Saghen commented May 20, 2025

It's not at the moment but I'd happily accept a PR for it. You could add the option here and then update the reference documentation for it.

soifou added a commit that referenced this issue May 21, 2025
Add `max_sync_buffer_size` and `max_async_buffer_size` options for
controlling processing mode.

Also refactor buffer source initialization to use unified option table
with basic validation.

Related #1789
Saghen pushed a commit that referenced this issue May 21, 2025
Add `max_sync_buffer_size` and `max_async_buffer_size` options for
controlling processing mode.

Also refactor buffer source initialization to use unified option table
with basic validation.

Related #1789
@soifou
Copy link
Collaborator

soifou commented May 21, 2025

BTW, is it possible to configure the #buf_text limit 20000 and 500000 through require('blink.cmp').setup ?

These options are available respectively through sources.provider.buffer.opts.max_sync_buffer_size and sources.provider.buffer.opts.max_async_buffer_size in the latest version.

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

Successfully merging a pull request may close this issue.

3 participants