feat: add toggle_doc functionality (#1647)

* feat: Add toggle_doc functionality

fix: Update docs view on entry change

* Replace toggle logic by open/close

* add docs and pinned flags

* add faq for disabling docs

* chore(git): ignore .DS_Store

---------

Co-authored-by: hrsh7th <629908+hrsh7th@users.noreply.github.com>
This commit is contained in:
Maria José Solano
2023-08-11 19:50:49 -07:00
committed by GitHub
parent 3b9f28061a
commit 1c03ebc7dc
7 changed files with 139 additions and 6 deletions

View File

@@ -181,6 +181,31 @@ cmp.scroll_docs = cmp.sync(function(delta)
end
end)
---Whether the documentation window is visible or not.
cmp.visible_docs = cmp.sync(function()
return cmp.core.view.docs_view:visible()
end)
---Opens the documentation window.
cmp.open_docs = cmp.sync(function()
if not cmp.visible_docs() then
cmp.core.view:open_docs()
return true
else
return false
end
end)
---Closes the documentation window.
cmp.close_docs = cmp.sync(function()
if cmp.visible_docs() then
cmp.core.view:close_docs()
return true
else
return false
end
end)
---Confirm completion
cmp.confirm = cmp.sync(function(option, callback)
option = option or {}