respect infercase
FAQ
- [X] I have checked the FAQ and it didn't resolve my problem.
Issues
- [X] I have checked existing issues and there are no open or closed issues with the same problem.
Neovim Version
0.6.0
Minimal reproducible config
source ./utils/vimrc.vim "taken from this repo, as of 5ddf3732c51587782de24bb717eada8fa0526eb4
set infercase
set ignorecase
Description
When infercase is set, completing a capitalized word by a lowercase suggestion removes the capital letters.
Steps to reproduce
Editing this file:
#define something 1
Some
and putting the cursor at the end of Some:
- with nvim-cmp,
somethingis suggested and if you select it, the capital letter ofSomeis replaced by a lower cases - with vanilla vim, typing
^X^D^Ncorrectly completesSomethingwith the capital letter
Expected behavior
Completion respects the capitalisation I typed
Actual behavior
capitalisation is replaced with the one of the suggestion
Additional context
Use case: when writing in a prose format (like plain text, tex or markdown) I am frequently suggested long words I already typed in the buffer. Suppose the the first occurrences of the word foobarbaz are inside a sentence (not capitalized) but I start typing Foobarbaz at the beginning of a sentence. If I accept nvim-cmp's suggestion foobarbaz capitalisation is removed. This is where I wanted to use infercase (but another buffer-local setting is also ok).
Hm... the vim docs say the infercase working only in keyword completion. I think it's a rational restriction.
I can't think the nvim-cmp contains this feature as properly at the moment.
Thank you for your feature request. it's insightful but hard to implement, I think.