diff --git a/doc/cmp.txt b/doc/cmp.txt index 0edf7c1..bdb12d0 100644 --- a/doc/cmp.txt +++ b/doc/cmp.txt @@ -162,6 +162,9 @@ NOTE: You can call these functions in mapping via `lua require('cmp').compl *cmp.visible* () Return the completion menu is visible or not. +*cmp.get_entries* () + Return current all entries. + *cmp.get_selected_entry* () Return current selected entry. (contains preselected) diff --git a/lua/cmp/init.lua b/lua/cmp/init.lua index bce0c14..6a4c617 100644 --- a/lua/cmp/init.lua +++ b/lua/cmp/init.lua @@ -96,6 +96,11 @@ cmp.get_active_entry = cmp.sync(function() return cmp.core.view:get_active_entry() end) +---Get current all entries +cmp.get_entries = cmp.sync(function() + return cmp.core.view:get_entries() +end) + ---Close current completion cmp.close = cmp.sync(function() if cmp.core.view:visible() then