From 8a1694ff330ed58ed29716686fcef79c28090354 Mon Sep 17 00:00:00 2001 From: Jose Vargas Date: Wed, 21 Jun 2023 07:57:52 -0600 Subject: [PATCH] Expand docs for select_next_item select_prev_item (#1626) --- doc/cmp.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/cmp.txt b/doc/cmp.txt index 00c1d3e..bfd7f37 100644 --- a/doc/cmp.txt +++ b/doc/cmp.txt @@ -172,9 +172,31 @@ NOTE: `lua require('cmp').complete()` can be used to call these functio *cmp.select_next_item* (option: { behavior = cmp.SelectBehavior, count = 1 }) Select the next item. Set count with large number to select pagedown. + `behavior` can be one of: + - `cmp.SelectBehavior.Insert`: Inserts the text at cursor. + - `cmp.SelectBehavior.Select`: Only selects the text, potentially adds ghost_text at + cursor. +>lua + cmp.setup { + mapping = { + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), + } + } +< *cmp.select_prev_item* (option: { behavior = cmp.SelectBehavior, count = 1 }) Select the previous item. Set count with large number to select pageup. + `behavior` can be one of: + - `cmp.SelectBehavior.Insert`: Inserts the text at cursor. + - `cmp.SelectBehavior.Select`: Only selects the text, potentially adds ghost_text at + cursor. +>lua + cmp.setup { + mapping = { + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), + } + } +< *cmp.scroll_docs* (delta: number) Scroll the documentation window if visible.