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

Maybe you want to merge #1

Open
MarcWeber opened this issue Mar 11, 2024 · 2 comments
Open

Maybe you want to merge #1

MarcWeber opened this issue Mar 11, 2024 · 2 comments
Labels
question Further information is requested

Comments

@MarcWeber
Copy link

https://github.com/MarcWeber/nvim-cmp-bufnames

I tried adding the features you have (bufs can return list of bufs),
Customizing add allows to add names without extension (or what I need full basename)
and it adds some caching which might be just good enough.

@rasulomaroff
Copy link
Owner

Hi there! I'm not sure I understood correctly what you're trying to solve with that, could you please provide more info on features you wanted to add?

  1. Caching - since the complete function is called each time when autocomplete is evoked, there isn't a lot of sense trying to cache buffers. Moreover, if you plan to do it, you need to actually subscribe to buffer events and manage them like that. While it's possible, it won't get you any boost in performance, but it will create complexity for such a simple extension. In your solution you're just checking a number of buffers open - this might not be enough since I can close a buffer and then open a new one. That way a number will be the same, but they could have different names (file names) and thus you will see your previous file name instead of a new one.
  2. Extensions - I think I already drop the extensions of files when putting them inside completions. Do you have issues with that? If so, could you please provide more details?

Btw, thanks to you I got back to my code to check it and found a small bug, where I forgot to write buffer names into the table to prevent duplicating. Thanks!

Overall, please provide more info on what you planned to do and we would think how it could be done!

@rasulomaroff rasulomaroff added the question Further information is requested label Mar 12, 2024
@rasulomaroff
Copy link
Owner

@MarcWeber do you want to make the function that gets you a list of buffers configurable? Is that what you wanted to do (as I see from your source files)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants