Skip to content

Commit 2fb2a3c

Browse files
docs: update and fix view documentation (hrsh7th#1868)
- correct view.follow_cursor to view.entries.follow_cursor - mention that view.entries.follow_cursor is custom view only - add missing view.entries.selection_order option - mention the docs class in list of classes nested under view class
1 parent b9fd19f commit 2fb2a3c

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

doc/cmp.txt

+15-5
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ NOTE: `<Cmd>lua require('cmp').complete()<CR>` can be used to call these functio
257257
`behavior=cmp.ConfirmBehavior.Insert`: inserts the selected item and
258258
moves adjacent text to the right (default).
259259
`behavior=cmp.ConfirmBehavior.Replace`: replaces adjacent text with
260-
the selected item.
260+
the selected item.
261261
>lua
262262
cmp.setup {
263263
mapping = {
@@ -676,7 +676,8 @@ sources[n].entry_filter~
676676

677677
*cmp-config.view*
678678
view~
679-
`{ entries: cmp.EntriesConfig|string }`
679+
`{ docs: cmp.DocsViewConfig }`
680+
`{ entries: cmp.EntriesViewConfig|string }`
680681
The view class used to customize nvim-cmp's appearance.
681682
Currently available configuration options are:
682683

@@ -686,12 +687,21 @@ view.docs.auto_open~
686687

687688
Specify whether to show the docs_view when selecting an item.
688689

689-
*cmp-config.view.follow_cursor*
690-
view.follow_cursor*
690+
*cmp-config.view.entries.selection_order*
691+
view.entries.selection_order~
692+
`string`
693+
694+
Specify whether to select the option in the pmenu that is at
695+
the top (`top_down`) or nearest to the cursor (`near_cursor`).
696+
Useful if pmenu is above cursor and you want to change default
697+
selection direction. Custom view only. `top_down` by default.
698+
699+
*cmp-config.view.entries.follow_cursor*
700+
view.entries.follow_cursor~
691701
`boolean`
692702

693703
Specify whether the pmenu should follow the current position of the cursor
694-
as the user types. `false` by default.
704+
as the user types. Custom view only. `false` by default.
695705

696706
*cmp-config.window.{completion,documentation}.border*
697707
window.{completion,documentation}.border~

0 commit comments

Comments
 (0)