nvim-cmp icon indicating copy to clipboard operation
nvim-cmp copied to clipboard

respect infercase

Open symphorien opened this issue 4 years ago • 1 comments

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, something is suggested and if you select it, the capital letter of Some is replaced by a lower case s
  • with vanilla vim, typing ^X^D^N correctly completes Something with 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).

symphorien avatar Jan 11 '22 16:01 symphorien

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.

hrsh7th avatar Jan 11 '22 16:01 hrsh7th