vimcomplete icon indicating copy to clipboard operation
vimcomplete copied to clipboard

Buffer fuzzy matching not handling dash well, for it splits words differently compared with "case" and "icase" matching

Open dougaak opened this issue 1 year ago • 1 comments

I encountered this issue when writing Powershell, which uses dash in function and cmdlet names such as "Set-Location".

For buffer words matching, when I use the default "icase" matching, words with dashes will be treated as a single whole word. Image

However, when I switch to use fuzzy search, words with dashes are split into different words. Image

Worse still is that no candidate is shown after hitting dash. Image

I took a look at the buffer.vim and it seems that the root cause is that, for fuzzy matching, a different function is used to generate the list of candidate words, the BufWords(). And in that function, the regex '\W\+' is used to split a buffer line, which treats dash as 'non-word' characters.

I think it'll be better to align the way words are split in different completion matcher options.

dougaak avatar Apr 10 '25 02:04 dougaak

I'm considering ending active maintenance of this plugin. Recently, I’ve been contributing new features directly to Vim's source code to improve its built-in auto-completion capabilities. These changes focus on enabling completion from user-defined functions, prioritizing relevant matches, and allowing match limits for specific completion sources.

You can follow the progress in these (unmerged) pull requests:

  • https://github.com/vim/vim/pull/17065
  • https://github.com/vim/vim/pull/17076
  • https://github.com/vim/vim/pull/17087

With these enhancements to Vim itself, this plugin may no longer be necessary—or at most, a minimal plugin might suffice to provide a few completion functions. Hopefully, the overall completion experience in Vim will be significantly improved as a result.

girishji avatar Apr 10 '25 05:04 girishji

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar May 11 '25 02:05 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 25 '25 03:05 github-actions[bot]