hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
8.16k stars 406 forks source link

fix: Error on using select_next_entry and select_prev_entry #1989

Closed thesantatitan closed 4 months ago

thesantatitan commented 4 months ago

Fixes #1988 get_selected_index was checking self.active before returning an index, which is actually false when select_next_entry is first called in typical usage using a mapping. Switched to how cursor was calculated before this PR #1986

samuelpx commented 4 months ago

Sorry, might be totally out of place adding this here, but:

This fixes next and prev, but for some reason my autocomplete prompt is not by default selecting the first item in the list, to get to it I need to select_next then select_prev, any idea why?

thesantatitan commented 4 months ago

@samuelpx link to your prompt? Or maybe post it here?

Shougo commented 4 months ago

It is the same fix?

https://github.com/hrsh7th/nvim-cmp/pull/1993

sjclayton commented 4 months ago

Fixed by #1993, this can be closed.