diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-01-30 14:39:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-30 14:39:13 +0800 |
commit | efa664c7ed21b63f2cf0a8caa53161fe7e32b2bb (patch) | |
tree | 5823bfb8aadf263a079818a96480dfd35f5d0685 /runtime | |
parent | 35c5e231078365033524b0aa2166118a1b2ef600 (diff) | |
download | rneovim-efa664c7ed21b63f2cf0a8caa53161fe7e32b2bb.tar.gz rneovim-efa664c7ed21b63f2cf0a8caa53161fe7e32b2bb.tar.bz2 rneovim-efa664c7ed21b63f2cf0a8caa53161fe7e32b2bb.zip |
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
https://github.com/vim/vim/commit/edd4ac3e895ce16034c7e098f1d68e0155d97886
Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/dev_vimpatch.txt | 1 | ||||
-rw-r--r-- | runtime/doc/news.txt | 1 | ||||
-rw-r--r-- | runtime/doc/options.txt | 6 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/options.lua | 6 |
4 files changed, 14 insertions, 0 deletions
diff --git a/runtime/doc/dev_vimpatch.txt b/runtime/doc/dev_vimpatch.txt index 5119613b55..76be24878a 100644 --- a/runtime/doc/dev_vimpatch.txt +++ b/runtime/doc/dev_vimpatch.txt @@ -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 diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 65417971ab..2208428f75 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -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. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 1f19db5eb9..b4ae3cc8fd 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -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 diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index f0f0d1a768..452959970d 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -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 |