hrsh7th / nvim-cmp

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

Check for complete pattern matches later in the target text #1900

Open iteratee opened 2 months ago

iteratee commented 2 months ago

This allows us to find the best match when trying to match "so" against "schemas/source_files.ex". Without this, bescause the 's' in "so" matches against "schemas", we never find the complete match against "source_files" later in the target. Look for a later total match and add it to the list if it is at least as good as the computed partial match so far. If we also have a partial-match continuation, prefer the longer of the 2 choices, or the single-piece match if they are the same length.