SelectBehavior.insert
merges completion with a following text
#1903
Labels
bug
Something isn't working
SelectBehavior.insert
merges completion with a following text
#1903
FAQ
Announcement
Minimal reproducible full config
Description
When selecting an item with
cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.insert })
and there is another word after the cursor position, some number of characters at the end of the selected item will not be inserted if the word after the cursor starts with these characters.This is a problem for me, since I typically select a completion item without confirming it, and this 'merging' behavior creates a problem when e.g. adding a new argument to a call, and the completion item name ends in the same word as the next argument.
Steps to reproduce
Expected behavior
The third line in the file should be 'aaab|bb' where | is the cursor position.
Actual behavior
The third line in the file is 'aaa|bb'.
Additional context
SelectBehavior.insert
differs fromConfirmBehavior.insert
in that when the completion is confirmed, the text after the cursor is not modified.So this would produce the expected behavior:
The code responsible for removing the trailing characters:
nvim-cmp/lua/cmp/entry.lua
Lines 274 to 282 in 8f3c541
And it was added in ef27b62.
The text was updated successfully, but these errors were encountered: