Expose get_selected_entry() from view module to main cmp module fixes #385 (#386)

* Expose get_selected_entry() from view module to main cmp module fixes #385

* add get_active_entry() also

* fix linting

* remove unused vars

Co-authored-by: alex.tylor <atylor@gmail.com>
This commit is contained in:
Alex Tylor
2021-10-22 09:47:55 +01:00
committed by GitHub
parent 8f92f57043
commit b546f50f09
5 changed files with 12 additions and 5 deletions

View File

@@ -49,6 +49,16 @@ cmp.visible = function()
return cmp.core.view:visible() or vim.fn.pumvisible() == 1
end
---Get current selected entry or nil
cmp.get_selected_entry = function()
return cmp.core.view:get_selected_entry()
end
---Get current active entry or nil
cmp.get_active_entry = function()
return cmp.core.view:get_active_entry()
end
---Close current completion
cmp.close = function()
if cmp.core.view:visible() then