feat(view): add api get_selected_index (#1986)

This commit is contained in:
NAKAI Tsuyoshi
2024-07-16 01:29:25 +09:00
committed by GitHub
parent 7e348da6e5
commit e1757aea61
5 changed files with 36 additions and 5 deletions

View File

@@ -211,6 +211,13 @@ view.scroll_docs = function(self, delta)
self.docs_view:scroll(delta)
end
---Get what number candidates are currently selected.
---If not selected, nil is returned.
---@return integer|nil
view.get_selected_index = function(self)
return self:_get_entries_view():get_selected_index()
end
---Select prev menu item.
---@param option cmp.SelectOption
view.select_next_item = function(self, option)