* 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 7569056388Closes#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>
To allow for using all available screen space, as we can omit a
max_height/max_width when creating a documentation popup). I've found this
to be useful with neovim-gtk's native GUI completion menus.
Problem: `cmp.WindowConfig` was defined twice.
Solution: Introduce
`cmp.CompletionWindowOptions` and `cmp.DocumentationWindowOptions`.
Make fields of these two class consistent with |cmp-config.window.*|
The entries_win:open function will fail when either the width or
the height of the window is less than 1, which will result in the
nvim_win_set_cursor being passed a nil value for self.entries_win.win
instead of a number, which causes an error to constantly appear when
the window is small. Hence, a guard clause to check for whether
self.entries_win.win is nil is added to stop the error from occurring.
Also fixed the rarer 'height' must be a positive Integer error caused
by the window.update function, within the clause to draw the scrollbar
background. This error happens on small windows when pressing and
holding down the backspace key to delete a lot of characters at once.
The nvim_open_win function call to create the scrollbar
background throws the error when self.style.height is 0. Hence, an
additional check is added alongside the info.scrollable check which also
skips drawing the scrollbar thumb as it is not needed when the height is
0 and will result in a weird scrollbar thumb floating some distance
away from the text when holding down backspace to delete a lot of
characters.
The no_symbol_match makes command line completion a lot less useful. It
disables any matches for file names with symbols in them. This prevents
completing things like ":b foo/bar" to ":b foo/bar.txt" or ":b foo_" to
":b baz/foo_bar.txt". Add an option `disallow_symbol_nonprefix_matching`
that prevents a match if it contains a symbol and isn't a prefix match.
Make that option the default. Add the option to documentation and tests.
Add to the examples for command line setup disabling the option.
* feat: sort source entries beforce slicing when using max_item_count
* feat: optimize filtering by max_item_count after sort
* fix: useless check if max_item_counts map is initialized
* fix: directly use entry source object when checking max_item_count
feedkeys_spec.lua:
In the "backspace test spec, the backspace
setting is given an integer, but only accepts
strings. Here, I assume that 0 was intended to
set backspace to a nil value, which can be done
with the empty string. I also corrected the name
of the test spec.
core_spec.lua:
In the "textedit" test spec, the actual and
expected outputs as well as the actual and
expected end characters did not match.