feat(view): add api get_selected_index (#1986)
This commit is contained in:
@@ -88,6 +88,12 @@ cmp.visible = cmp.sync(function()
|
||||
return cmp.core.view:visible() or vim.fn.pumvisible() == 1
|
||||
end)
|
||||
|
||||
---Get what number candidates are currently selected.
|
||||
---If not selected, nil is returned.
|
||||
cmp.get_selected_index = cmp.sync(function()
|
||||
return cmp.core.view:get_selected_index()
|
||||
end)
|
||||
|
||||
---Get current selected entry or nil
|
||||
cmp.get_selected_entry = cmp.sync(function()
|
||||
return cmp.core.view:get_selected_entry()
|
||||
|
||||
Reference in New Issue
Block a user