mirror of
https://github.com/neovim/neovim.git
synced 2025-10-20 00:31:49 +00:00
vim-patch:9.1.1797: completion: autocompletion can be improved
Problem: completion: autocompletion can be improved
Solution: Add support for "longest" and "preinsert" in 'autocomplete';
add preinserted() (Girish Palya)
* Add support for "longest" in 'completeopt' when 'autocomplete'
is enabled. (Note: the cursor position does not change automatically
when 'autocomplete' is enabled.)
* Add support for "preinsert" when 'autocomplete' is enabled. Ensure
"preinsert" works the same with and without 'autocomplete'
* introduce the preinserted() Vim script function, useful for defining
custom key mappings.
fixes: vim/vim#18314
closes: vim/vim#18387
c05335082a
Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
@@ -8024,6 +8024,18 @@ M.funcs = {
|
||||
returns = 'number',
|
||||
signature = 'pow({x}, {y})',
|
||||
},
|
||||
preinserted = {
|
||||
desc = [=[
|
||||
Returns non-zero if text has been inserted after the cursor
|
||||
because "preinsert" is present in 'completeopt', or if
|
||||
"longest" is present in 'completeopt' while 'autocomplete'
|
||||
is enabled. Otherwise returns zero.
|
||||
]=],
|
||||
name = 'preinserted',
|
||||
params = {},
|
||||
returns = 'number',
|
||||
signature = 'preinserted()',
|
||||
},
|
||||
prevnonblank = {
|
||||
args = 1,
|
||||
base = 1,
|
||||
|
Reference in New Issue
Block a user