From bf62672d59299cc548103bdf7d8d162043acd011 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 11 Sep 2024 06:04:57 +0800 Subject: vim-patch:26e4b00: runtime(doc): Revert outdated comment in completeopt's fuzzy documentation Originally, `:set completeopt+=fuzzy` did not affect how the candidate list is collected in default keyword completion. A comment was added to documentation as part of vim/vim#14912 to clarify it. vim/vim#15193 later changed the fuzzy behavior to now change the candidate collection behavior as well so the clarification in docs is now wrong. Remove them here. closes: vim/vim#15656 https://github.com/vim/vim/commit/26e4b000025ea0e25ea7877314d9095737431bae Co-authored-by: Yee Cheng Chin --- runtime/lua/vim/_meta/options.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 46366d585b..58a8da4f26 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1063,10 +1063,7 @@ vim.go.cia = vim.go.completeitemalign --- fuzzy Enable `fuzzy-matching` for completion candidates. This --- allows for more flexible and intuitive matching, where --- characters can be skipped and matches can be found even ---- if the exact sequence is not typed. Only makes a ---- difference how completion candidates are reduced from the ---- list of alternatives, but not how the candidates are ---- collected (using different completion types). +--- if the exact sequence is not typed. --- --- longest Only insert the longest common text of the matches. If --- the menu is displayed you can use CTRL-L to add more -- cgit From 90d59e6c8aa6141c54f81586df423e5a76e009f9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 7 Mar 2025 08:18:33 +0800 Subject: vim-patch:9.1.1178: not possible to generate completion candidates using fuzzy matching Problem: not possible to generate completion candidates using fuzzy matching Solution: add the 'completefuzzycollect' option for (some) ins-completion modes (glepnir) fixes vim/vim#15296 fixes vim/vim#15295 fixes vim/vim#15294 closes: vim/vim#16032 https://github.com/vim/vim/commit/f31cfa29bf72b0cdf6fa1b60346ea4e187bcafd1 Co-authored-by: glepnir --- runtime/lua/vim/_meta/options.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 58a8da4f26..cb199231c7 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1044,6 +1044,21 @@ vim.o.cfu = vim.o.completefunc vim.bo.completefunc = vim.o.completefunc vim.bo.cfu = vim.bo.completefunc +--- This option enables fuzzy collection for (only some) specific +--- `ins-completion` modes, adjusting how items are gathered for fuzzy +--- matching based on input. +--- The option can contain the following values (separated by commas), +--- each enabling fuzzy collection for a specific completion mode: +--- files file names +--- keyword keyword completion in 'complete' and current file +--- whole_line whole lines +--- +--- @type string +vim.o.completefuzzycollect = "" +vim.o.cfc = vim.o.completefuzzycollect +vim.go.completefuzzycollect = vim.o.completefuzzycollect +vim.go.cfc = vim.go.completefuzzycollect + --- A comma-separated list of strings that controls the alignment and --- display order of items in the popup menu during Insert mode --- completion. The supported values are "abbr", "kind", and "menu". @@ -1063,7 +1078,12 @@ vim.go.cia = vim.go.completeitemalign --- fuzzy Enable `fuzzy-matching` for completion candidates. This --- allows for more flexible and intuitive matching, where --- characters can be skipped and matches can be found even ---- if the exact sequence is not typed. +--- if the exact sequence is not typed. Note: This option +--- does not affect the collection of candidate list, it only +--- controls how completion candidates are reduced from the +--- list of alternatives. If you want to use `fuzzy-matching` +--- to gather more alternatives for your candidate list, +--- see `'completefuzzycollect'`. --- --- longest Only insert the longest common text of the matches. If --- the menu is displayed you can use CTRL-L to add more -- cgit From 10fde593f177fb7655c5f1c2b9774509e90c6106 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 8 Mar 2025 05:58:00 +0800 Subject: vim-patch:9.1.1182: No cmdline completion for 'completefuzzycollect' Problem: No cmdline completion for the 'completefuzzycollect' option (after v9.1.1178) Solution: Add cmdline completion for the 'completefuzzycollect' option, improve its description in optwin.vim (zeertzjq). closes: vim/vim#16813 https://github.com/vim/vim/commit/53d59ecc1d93ce3a3f6d0182479d825852018ceb No code change is needed in Nvim as Nvim uses expand_set_str_generic() by default. --- runtime/lua/vim/_meta/options.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index cb199231c7..e473558207 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1078,10 +1078,10 @@ vim.go.cia = vim.go.completeitemalign --- fuzzy Enable `fuzzy-matching` for completion candidates. This --- allows for more flexible and intuitive matching, where --- characters can be skipped and matches can be found even ---- if the exact sequence is not typed. Note: This option +--- if the exact sequence is not typed. Note: This option --- does not affect the collection of candidate list, it only --- controls how completion candidates are reduced from the ---- list of alternatives. If you want to use `fuzzy-matching` +--- list of alternatives. If you want to use `fuzzy-matching` --- to gather more alternatives for your candidate list, --- see `'completefuzzycollect'`. --- -- cgit From 28f61994748e1edd5fb1755ddf2e5ca1324b5635 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 13 Mar 2025 07:08:25 +0800 Subject: vim-patch:9.1.1197: process_next_cpt_value() uses wrong condition Problem: process_next_cpt_value() uses wrong condition Solution: use cfc_has_mode() instead and remove redundant else if branch (glepnir) closes: vim/vim#16833 https://github.com/vim/vim/commit/53b14578e03f93a53fd6eb21c00caf96484742ed Co-authored-by: glepnir --- runtime/lua/vim/_meta/options.lua | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index e473558207..e1e793b533 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1044,14 +1044,23 @@ vim.o.cfu = vim.o.completefunc vim.bo.completefunc = vim.o.completefunc vim.bo.cfu = vim.bo.completefunc ---- This option enables fuzzy collection for (only some) specific ---- `ins-completion` modes, adjusting how items are gathered for fuzzy ---- matching based on input. ---- The option can contain the following values (separated by commas), ---- each enabling fuzzy collection for a specific completion mode: ---- files file names ---- keyword keyword completion in 'complete' and current file ---- whole_line whole lines +--- A comma-separated list of option enables fuzzy collection for specific +--- `ins-completion` modes, affecting how items are gathered during +--- completion. When set, fuzzy matching is used to find completion +--- candidates instead of the standard prefix-based matching. This option +--- can contain the following values are: +--- +--- keyword keywords in the current file `i_CTRL-X_CTRL-N` +--- keywords with the ".", "w", "b", "u", "U" and +--- "k{dict}" flags in 'complete'. `i_CTRL-N` `i_CTRL-P` +--- +--- files file names `i_CTRL-X_CTRL-F` +--- +--- whole_line whole lines `i_CTRL-X_CTRL-L` +--- +--- When used with 'completeopt' "longest" option, fuzzy collection can +--- identify the longest common string among the best fuzzy matches and +--- automatically insert it. --- --- @type string vim.o.completefuzzycollect = "" -- cgit From 5975ddbdb85073ce055a24915de7f6960e201dc4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 14 Mar 2025 06:33:35 +0800 Subject: vim-patch:1dc731a: runtime(doc): make :h 'completefuzzycollect' a bit clearer - Fix grammar - Use "matches" instead of "items" ("completion candidates" is used in some other places, but it's a bit verbose) - "When set" is a bit vague, instead use "For specified modes" closes: vim/vim#16871 https://github.com/vim/vim/commit/1dc731a49ff5d06ead4b506afa04288a5baafc1a --- runtime/lua/vim/_meta/options.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index e1e793b533..a3cb5042aa 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1044,11 +1044,11 @@ vim.o.cfu = vim.o.completefunc vim.bo.completefunc = vim.o.completefunc vim.bo.cfu = vim.bo.completefunc ---- A comma-separated list of option enables fuzzy collection for specific ---- `ins-completion` modes, affecting how items are gathered during ---- completion. When set, fuzzy matching is used to find completion ---- candidates instead of the standard prefix-based matching. This option ---- can contain the following values are: +--- A comma-separated list of strings to enable fuzzy collection for +--- specific `ins-completion` modes, affecting how matches are gathered +--- during completion. For specified modes, fuzzy matching is used to +--- find completion candidates instead of the standard prefix-based +--- matching. This option can contain the following values: --- --- keyword keywords in the current file `i_CTRL-X_CTRL-N` --- keywords with the ".", "w", "b", "u", "U" and -- cgit From e39cdafed96813567128c931a6b784b6858dcc13 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 14 Mar 2025 07:42:54 +0800 Subject: vim-patch:9.1.1201: 'completefuzzycollect' does not handle dictionary correctly Problem: 'completefuzzycollect' does not handle dictionary correctly Solution: check for ctrl_x_mode_dictionary (glepnir) closes: vim/vim#16867 https://github.com/vim/vim/commit/587601671cd06ddc4d78f907d98578cdab96003f Cherry-pick a documentation fix from later. Co-authored-by: glepnir --- runtime/lua/vim/_meta/options.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index a3cb5042aa..20d8ac3058 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1050,17 +1050,18 @@ vim.bo.cfu = vim.bo.completefunc --- find completion candidates instead of the standard prefix-based --- matching. This option can contain the following values: --- ---- keyword keywords in the current file `i_CTRL-X_CTRL-N` ---- keywords with the ".", "w", "b", "u", "U" and ---- "k{dict}" flags in 'complete'. `i_CTRL-N` `i_CTRL-P` +--- keyword keywords in the current file `i_CTRL-X_CTRL-N` +--- keywords with flags ".", "w", `i_CTRL-N` `i_CTRL-P` +--- "b", "u", "U" and "k{dict}" in 'complete' +--- keywords in 'dictionary' `i_CTRL-X_CTRL-K` --- ---- files file names `i_CTRL-X_CTRL-F` +--- files file names `i_CTRL-X_CTRL-F` --- ---- whole_line whole lines `i_CTRL-X_CTRL-L` +--- whole_line whole lines `i_CTRL-X_CTRL-L` --- ---- When used with 'completeopt' "longest" option, fuzzy collection can ---- identify the longest common string among the best fuzzy matches and ---- automatically insert it. +--- When using the 'completeopt' "longest" option value, fuzzy collection +--- can identify the longest common string among the best fuzzy matches +--- and insert it automatically. --- --- @type string vim.o.completefuzzycollect = "" -- cgit