Skip to content

feat: output preview with ghost text, including for snippets #186

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 12 commits into from
Oct 25, 2024

Conversation

giuxtaposition
Copy link
Contributor

@giuxtaposition giuxtaposition commented Oct 24, 2024

This PR adds output preview with ghost text.
I've been using this plugin for a few weeks and missed this nvim-cmp feature (even though it was still experimental)

Features:

  • Show ghost text to preview suggestion output when there is a selected item
  • Support snippets
  • Show ghost text only when enabled in user config
  • Handle fuzzy match

@Saghen I'm not sure windows is the correct folder location for this module, let me know if you think it should be moved.

Also I'm not sure what should be displayed when the suggestion is fuzzy matched.
Right now it displays the whole suggestion. Example:
image

Copy link
Owner

@Saghen Saghen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! It's working great on my machine. I would match the behavior of nvim-cmp wrt how it should be displayed when fuzzy matched. The windows folder works with me

@giuxtaposition
Copy link
Contributor Author

I looked up how nvim-cmp handles the fuzzy match and reworked a bit how to get the ghost text. It should work the same now.

blink.cmp:
Screenshot-2024-10-25_12:56:33

nvim-cmp:
Screenshot-2024-10-25_12:58:00

@Saghen Saghen merged commit 6d25187 into Saghen:main Oct 25, 2024
@Saghen
Copy link
Owner

Saghen commented Oct 25, 2024

Super clean implementation, tysm!

@giuxtaposition giuxtaposition deleted the ghost-text branch October 25, 2024 16:30
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.

2 participants