Skip to content

completions inserted strangely when trigger.completion.keyword_range = "full" #268

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
stefanboca opened this issue Nov 5, 2024 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@stefanboca
Copy link
Collaborator

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

Screencast.From.2024-11-04.22-51-32.mp4

When keyword_range = "full", inserting a completions from the middle of a word duplicates the last character if the last character is the end of the phrase. The ghost text is also incorrect (it appears a few characters after the cursor).

Screencast.From.2024-11-04.22-58-43.mp4

This does not occur when there is no space after the current word.

Screencast.From.2024-11-04.23-00-58.mp4

Additionally, when keyword_range = "full" I noticed that if the cursor is in the middle of the word, and the second half doesn't match any completions, no completions are displayed (even if manually triggered). I'm sure this is a tricky edge case, but I would prefer the behavior to fallback to normal completions in this case.

Relevant configuration

trigger = {
  completion = {
    keyword_range = "full"
  }
}

neovim version

NVIM v0.11.0-dev+1090-g99acc9de5 Build type: RelWithDebInfo LuaJIT 2.1.1720049189

blink.cmp version: branch, tag, or commit

main (1628800)

@stefanboca stefanboca added the bug Something isn't working label Nov 5, 2024
@stefanboca
Copy link
Collaborator Author

stefanboca commented Nov 27, 2024

I actually just checked to see if this still happens after #389 (and it does), but I noticed this actually looks like a matching issue:
image
You can see the last r is not being matched.

@Saghen Saghen closed this as completed in 160b687 Dec 2, 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