roxma / nvim-completion-manager

:warning: PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
MIT License
917 stars 49 forks source link

Dash character closes the autocomplete dropdown / fails to match #168

Closed mike-hearn closed 6 years ago

mike-hearn commented 6 years ago

I'm using NCM with the fuzzy matcher turned on, and I've noticed that when attempting to auto-complete CSS tags containing dashes (e.g. .shows-you-might-like), it matches fine after typing .shows but when followed with a -, it stops.

I am not sure if this is an NCM issue or a larger issue with Vim, but I figured I would start the discussion here.

Is there a way to include the - character as part of the autocomplete search? (I should note it is already included as part of iskeyword in my vimrc).

See the gif below for an example of this in action:

NCM autocomplete issue with dashes

roxma commented 6 years ago

Which version are you using?

I cannot reproduce the issue.

Unfortunately, current implementation of the tag source only supports prefix matching.

mike-hearn commented 6 years ago

If you're able to run Docker, I put together an image with my setup that should help reproduce it.

Run (or build the image yourself from the Dockerfile):

docker run --rm -ti mikehearn/ncm-dash-issue nvim wnyc-web-client/app/styles/legacy/_home-compat.scss

This will launch you into a containerized nvim instance, editing a .scss file.

Try adding .bucket-title, and you'll see it stop autocompleting after typing .bucket- (gif below, you should be able to reproduce this exactly). With the fuzzy finder, typing .buckettitle matches, but with a dash - .bucket-title - it fails.

Gif of me reproducing the dash issue

mike-hearn commented 6 years ago

THANK YOU!

Also just a heads up, it looks like 45a4812 just assigned _patterns['css'] to itself instead of to _patterns['scss']?