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:
committed by
GitHub
parent
3b9f28061a
commit
1c03ebc7dc
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user