hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.53k stars 377 forks source link

Request: case-sensitive completion #1696

Open RobinTruax opened 10 months ago

RobinTruax commented 10 months ago

I'm using nvim-cmp for completing prose in a LaTeX Neovim config that I'm creating. I've created a dictionary of prose words, but I want autocompletion for it to be case-sensitive. Is there an option for this, or some way to override the matcher to force it to be case-sensitive?

Andrew15-5 commented 3 months ago

It's already case-sensitive for non-Latin letters, unfortunately (for me).

fionn commented 2 days ago

I believe it is not possible (for alphanumeric strings) because matcher.lua makes use of char.match from https://github.com/hrsh7th/nvim-cmp/blob/d818fd0624205b34e14888358037fb6f5dc51234/lua/cmp/utils/char.lua#L109-L115 which is explicitly case insensitive.

Shougo commented 2 days ago

https://github.com/hrsh7th/nvim-cmp/blob/d818fd0624205b34e14888358037fb6f5dc51234/lua/cmp/matcher.lua#L27

nvim-cmp uses case-sensitive as scoring.