vim-patch:9.1.1750: completion: preinserted text highlighed using ComplMatchIns

Problem:  completion: preinserted text highlighed using ComplMatchIns
Solution: Use highlighting group PreInsert and update the documentation
          (Girish Palya).

When "preinsert" is included in 'completeopt', only the PreInsert
highlight group should be applied, whether autocompletion is active or not.
Previously, ComplMatchIns was used when autocompletion was not enabled.

Related to https://github.com/vim/vim/pull/18213.

closes: vim/vim#18254

2525c56e42

Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
zeertzjq
2025-09-10 16:08:21 +08:00
parent 9076fdc123
commit 5a7586a109
6 changed files with 21 additions and 18 deletions

View File

@@ -1702,13 +1702,13 @@ local options = {
preinsert
When autocompletion is not enabled, inserts the part of the
first candidate word beyond the current completion leader,
highlighted with |hl-ComplMatchIns|. The cursor does not
highlighted with |hl-PreInsert|. The cursor does not
move. Requires "fuzzy" unset and "menuone" in 'completeopt'.
When 'autocomplete' is enabled, inserts the longest common
prefix of matches (from all shown items or buffer-specific
matches), highlighted with |hl-PreInsert|. This occurs only
when no menu item is selected. Press CTRL-Y to accept.
prefix of matches (from all shown items or from the
current buffer items). This occurs only when no menu item
is selected. Press CTRL-Y to accept.
preview Show extra information about the currently selected
completion in the preview window. Only works in