feat: add option for view to follow cursor (#1727)

* feat: add option for custom entry view to follow cursor

Creates an option to allow the custom entries
view to follow the user's cursor as they type.

To enable, set
```lua
require("cmp").setup({
  view = {
    entries = {
      follow_cursor = true
    }
  }
})
```

Original source at 7569056388

Closes #1660

Co-authored-by: lvimuser <109605931+lvimuser@users.noreply.github.com>

* doc: add view.follow_cursor option to docs

---------

Co-authored-by: lvimuser <109605931+lvimuser@users.noreply.github.com>
This commit is contained in:
mcauley-penney
2024-03-30 23:46:16 -07:00
committed by GitHub
parent 97dc716fc9
commit 7aa3f71932
4 changed files with 14 additions and 2 deletions

View File

@@ -184,6 +184,7 @@ cmp.ItemField = {
---@class cmp.CustomEntriesViewConfig
---@field name 'custom'
---@field selection_order 'top_down'|'near_cursor'
---@field follow_cursor boolean
---@class cmp.NativeEntriesViewConfig
---@field name 'native'