From b9ef85d483fd52b5a0b8e161c19bbcc1d9c6f40a Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Sun, 29 Aug 2021 21:41:50 +0900 Subject: [PATCH] Add Programatic API documents --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index cc74610..83c78a1 100644 --- a/README.md +++ b/README.md @@ -352,6 +352,40 @@ Specify preselect mode. The following modes are available. Default: `cmp.PreselectMode.Item` +Programatic API +==================== + +You can use the following APIs. + +#### `cmp.confirm({ select = boolean, behavior = cmp.ConfirmBehavior.{Insert,Replace} })` + +Confirm current selected item if possible. + +#### `cmp.complete()` + +Invoke manual completion. + +#### `cmp.close()` + +Close current completion menu. + +#### `cmp.abort()` + +Close current completion menu and restore current line (similar to native `` behavior). + +#### `cmp.select_next_item()` + +Select next completion item if possible. + +#### `cmp.select_prev_item()` + +Select prev completion item if possible. + +#### `cmp.scroll_docs(delta)` + +Scroll documentation window if possible. + + FAQ ====================