Skip to content

Fuzzy completion is incorrect when completeopt contains longest #15295

@roccomao

Description

@roccomao

Steps to reproduce

  1. vim -u NONE -U NONE
  2. input: xyz xzy (begin with the letter x)
  3. set completeopt+=fuzzy
  4. enter y or z, then press <C-n>, both xyz and xzy will appear in the candidate list
  5. set completeopt+=longest
  6. repeat step 4, now the xyz is the only match

Expected behaviour

When set completeopt+=longest,fuzzy, if we enter y or z, then press <C-n>, both xyz and xzy will appear in the candidate list, or neither will appear. Of course, it is best if neither will appear in the candidate list.

Version of Vim

9.1.0598

Environment

The bug was introduced by patch 9.1.0598

Logs and stack traces

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions