mirror of
https://github.com/neovim/neovim.git
synced 2026-11-02 20:30:40 -06:00
vim-patch:9.2.1004: a completion function cannot tell why it was called (#41500)
Problem: A function used through 'omnifunc' or 'complete' is called the
same way whether 'autocomplete' started the completion or a
key asked for one, so it cannot answer differently.
Solution: Report which of the two it is in complete_info() as "auto". It
is returned only when asked for in {what}, so what
complete_info() says by itself does not change
(Hirohito Higashi).
closes: vim/vim#21143
https://github.com/vim/vim/commit/1f56c351dedad288f79c89b6b6f64be762ec3b9b
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
This commit is contained in:
1 parent
0f0e89fd90
commit
ec982dfb93
6 files changed
+90
-1
No files matched your search
@@ -1316,6 +1316,12 @@ complete_info([{what}]) *complete_info()*
|
||||
Returns a |Dictionary| with information about Insert mode
|
||||
completion. See |ins-completion|.
|
||||
The items are:
|
||||
auto |TRUE| when Vim started this completion by
|
||||
itself, which is what 'autocomplete' does,
|
||||
and |FALSE| when a key asked for it, such as
|
||||
|i_CTRL-X_CTRL-O|. A |complete-functions|
|
||||
function can read this to tell the two apart.
|
||||
Returned only when asked for in {what}.
|
||||
completed Return a dictionary containing the entries of
|
||||
the currently selected index item.
|
||||
items List of all completion candidates. Each item
|
||||
|
||||
Generated
+6
@@ -1135,6 +1135,12 @@ function vim.fn.complete_check() end
|
||||
--- Returns a |Dictionary| with information about Insert mode
|
||||
--- completion. See |ins-completion|.
|
||||
--- The items are:
|
||||
--- auto |TRUE| when Vim started this completion by
|
||||
--- itself, which is what 'autocomplete' does,
|
||||
--- and |FALSE| when a key asked for it, such as
|
||||
--- |i_CTRL-X_CTRL-O|. A |complete-functions|
|
||||
--- function can read this to tell the two apart.
|
||||
--- Returned only when asked for in {what}.
|
||||
--- completed Return a dictionary containing the entries of
|
||||
--- the currently selected index item.
|
||||
--- items List of all completion candidates. Each item
|
||||
|
||||
Reference in new issue
Block a user