vim / vim

The official Vim repository
https://www.vim.org
Vim License
36.24k stars 5.41k forks source link

Fuzzy completion does not allow cycle back to original, wrong highlight, and Ctrl-P Ctrl-N issues #15095

Closed nv-quan closed 2 months ago

nv-quan commented 3 months ago

Steps to reproduce

  1. vim -Nu NONE
  2. :set completeopt+=fuzzy
  3. type "hello helio hero" in the first line
  4. type "he" in the second line, and then press <C-X><C-P> This happens: image

There are 3 separate issues:

  1. the menu highlight is at "hello" but the completion is "hero"
  2. repeatedly pressing <C-P> gets stuck at the first selection and does not cycle back
  3. repeatedly pressing <C-N> does cycle back to the first option but does not cycle back to the original. In other word, this screen never happens: image

Expected behaviour

1, 2, 3 should work as if fuzzy is not set

Version of Vim

Vim 9.1 patch 1-516

Environment

MacOS, Iterm2, Tmux

Logs and stack traces

No response

chrisbra commented 3 months ago

@glepnir please