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

@@ -95,6 +95,9 @@ return function()
name = 'custom',
selection_order = 'top_down',
},
docs = {
auto_open = true,
}
},
window = {

View File

@@ -178,6 +178,24 @@ mapping.scroll_docs = function(delta)
end
end
--- Opens the documentation window.
mapping.open_docs = function()
return function(fallback)
if not require('cmp').open_docs() then
fallback()
end
end
end
--- Close the documentation window.
mapping.close_docs = function()
return function(fallback)
if not require('cmp').close_docs() then
fallback()
end
end
end
---Select next completion item.
mapping.select_next_item = function(option)
return function(fallback)