mirror of
https://github.com/neovim/neovim.git
synced 2026-07-18 23:21:35 +00:00
vim-patch:9.1.1056: Vim doesn't highlight to be inserted text when completing (#32251)
Problem: Vim doesn't highlight to be inserted text when completing
Solution: Add support for the "preinsert" 'completeopt' value
(glepnir)
Support automatically inserting the currently selected candidate word
that does not belong to the latter part of the leader.
fixes: vim/vim#3433
closes: vim/vim#16403
edd4ac3e89
Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
@@ -188,6 +188,7 @@ information.
|
||||
vim_strcat strncat xstrlcat
|
||||
VIM_ISWHITE ascii_iswhite
|
||||
IS_WHITE_OR_NUL ascii_iswhite_or_nul
|
||||
IS_WHITE_NL_OR_NUL ascii_iswhite_nl_or_nul
|
||||
vim_isalpha mb_isalpha
|
||||
vim_isNormalIDc ascii_isident
|
||||
vim_islower vim_isupper mb_islower mb_isupper
|
||||
|
||||
@@ -309,6 +309,7 @@ LUA
|
||||
OPTIONS
|
||||
|
||||
• 'completeopt' flag "fuzzy" enables |fuzzy-matching| during |ins-completion|.
|
||||
• 'completeopt' flag "preinsert" highlights text to be inserted.
|
||||
• 'messagesopt' configures |:messages| and |hit-enter| prompt.
|
||||
• 'tabclose' controls which tab page to focus when closing a tab page.
|
||||
|
||||
|
||||
@@ -1575,6 +1575,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
scores when "fuzzy" is enabled. Candidates will appear
|
||||
in their original order.
|
||||
|
||||
preinsert
|
||||
Preinsert the portion of the first candidate word that is
|
||||
not part of the current completion leader and using the
|
||||
|hl-ComplMatchIns| highlight group. Does not work when
|
||||
"fuzzy" is also included.
|
||||
|
||||
*'completeslash'* *'csl'*
|
||||
'completeslash' 'csl' string (default "")
|
||||
local to buffer
|
||||
|
||||
6
runtime/lua/vim/_meta/options.lua
generated
6
runtime/lua/vim/_meta/options.lua
generated
@@ -1102,6 +1102,12 @@ vim.go.cia = vim.go.completeitemalign
|
||||
--- scores when "fuzzy" is enabled. Candidates will appear
|
||||
--- in their original order.
|
||||
---
|
||||
--- preinsert
|
||||
--- Preinsert the portion of the first candidate word that is
|
||||
--- not part of the current completion leader and using the
|
||||
--- `hl-ComplMatchIns` highlight group. Does not work when
|
||||
--- "fuzzy" is also included.
|
||||
---
|
||||
--- @type string
|
||||
vim.o.completeopt = "menu,preview"
|
||||
vim.o.cot = vim.o.completeopt
|
||||
|
||||
Reference in New Issue
Block a user