diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2025-09-30 09:54:02 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-30 09:54:02 +0800 |
| commit | 77545c0f3c485f366a08b91c10ff48e42ca2fc49 (patch) | |
| tree | 01a88c6aac6780136d29f4a089730f76b448f355 /runtime/lua | |
| parent | 4896178863dc912baaf68ddcddab28eecc8f00d7 (diff) | |
| parent | 756e55dc490d98f9ec09885bb6261e8160ebf914 (diff) | |
| download | rneovim-77545c0f3c485f366a08b91c10ff48e42ca2fc49.tar.gz rneovim-77545c0f3c485f366a08b91c10ff48e42ca2fc49.tar.bz2 rneovim-77545c0f3c485f366a08b91c10ff48e42ca2fc49.zip | |
Merge pull request #35962 from zeertzjq/vim-9.1.1797
vim-patch:9.1.{1797,1800,1810}
Diffstat (limited to 'runtime/lua')
| -rw-r--r-- | runtime/lua/vim/_meta/options.lua | 42 | ||||
| -rw-r--r-- | runtime/lua/vim/_meta/vimfn.lua | 8 |
2 files changed, 34 insertions, 16 deletions
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 6323d11d4c..4adad760e9 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1183,11 +1183,22 @@ vim.go.cia = vim.go.completeitemalign --- 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 ---- characters. Whether case is ignored depends on the kind ---- of completion. For buffer text the 'ignorecase' option is ---- used. +--- longest +--- When 'autocomplete' is not active, only the longest +--- common prefix of the matches is inserted. If the popup +--- menu is displayed, you can use CTRL-L to add more +--- characters. Whether case is ignored depends on the type +--- of completion. For buffer text the 'ignorecase' option +--- applies. +--- +--- When 'autocomplete' is active and no completion item is +--- selected, the longest common prefix of the matches is +--- inserted after the cursor. The prefix is taken either +--- from all displayed items or only from items in the current +--- buffer. The inserted text is highlighted with +--- `hl-PreInsert`, and the cursor position does not change +--- (similar to `"preinsert"`). Press CTRL-Y to accept. +--- See also `preinserted()`. --- --- menu Use a popup menu to show the possible completions. The --- menu is only shown when there is more than one match and @@ -1220,22 +1231,21 @@ vim.go.cia = vim.go.completeitemalign --- with "menu" or "menuone". Overrides "preview". --- --- preinsert ---- When 'autocomplete' is not active, inserts the part of the ---- first candidate word beyond the current completion leader, ---- highlighted with `hl-PreInsert`. The cursor doesn't move. ---- Requires "fuzzy" unset and "menuone" in 'completeopt'. ---- ---- When 'autocomplete' is active, inserts the longest common ---- 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. +--- Inserts the text of the first completion candidate +--- beyond the current leader, highlighted with `hl-PreInsert`. +--- The cursor does not move. +--- Requires "fuzzy" to be unset, and either "menuone" in +--- 'completeopt' or 'autocomplete' enabled. When +--- 'autocomplete' is enabled, this does not work if +--- 'ignorecase' is set without 'infercase'. +--- See also `preinserted()`. --- --- preview Show extra information about the currently selected --- completion in the preview window. Only works in --- combination with "menu" or "menuone". --- ---- Only "fuzzy", "popup", "preinsert" and "preview" have an effect when ---- 'autocomplete' is enabled. +--- Only "fuzzy", "longest", "popup", "preinsert" and "preview" have an +--- effect when 'autocomplete' is enabled. --- --- This option does not apply to `cmdline-completion`. See 'wildoptions' --- for that. diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 4302c3d689..830882c9c1 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -6554,6 +6554,14 @@ function vim.fn.perleval(expr) end --- @return number function vim.fn.pow(x, y) end +--- Returns non-zero if text has been inserted after the cursor +--- because "preinsert" is present in 'completeopt', or because +--- "longest" is present in 'completeopt' while 'autocomplete' +--- is active. Otherwise returns zero. +--- +--- @return number +function vim.fn.preinserted() end + --- Return the line number of the first line at or above {lnum} --- that is not blank. Example: >vim --- let ind = indent(prevnonblank(v:lnum - 1)) |