vim-patch:9.1.1374: completion: 'smartcase' not respected when filtering matches

Problem:  Currently, 'smartcase' is respected when completing keywords
          using <C-N>, <C-P>, <C-X><C-N>, and <C-X><C-P>. However, when
          a user continues typing and the completion menu is filtered
          using cached matches, 'smartcase' is not applied. This leads
          to poor-quality or irrelevant completion suggestions, as shown
          in the example below.
Solution: When filtering cached completion items after typing additional
          characters, apply case-sensitive comparison if 'smartcase' is
          enabled and the typed pattern includes uppercase characters.
          This ensures consistent and expected completion behavior.
          (Girish Palya)

closes: vim/vim#17271

dc314053e1

Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
zeertzjq
2025-05-09 06:30:59 +08:00
parent 6b955af875
commit 15d31fe7a6
8 changed files with 111 additions and 10 deletions

View File

@@ -8095,9 +8095,11 @@ local options = {
Override the 'ignorecase' option if the search pattern contains upper
case characters. Only used when the search pattern is typed and
'ignorecase' option is on. Used for the commands "/", "?", "n", "N",
":g" and ":s". Not used for "*", "#", "gd", tag search, etc. After
"*" and "#" you can make 'smartcase' used by doing a "/" command,
recalling the search pattern from history and hitting <Enter>.
":g" and ":s" and when filtering matches for the completion menu
|compl-states|.
Not used for "*", "#", "gd", tag search, etc. After "*" and "#" you
can make 'smartcase' used by doing a "/" command, recalling the search
pattern from history and hitting <Enter>.
]=],
full_name = 'smartcase',
scope = { 'global' },