-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Score contiguous matches higher #18
Comments
A query-inverting delimiter doesn't imply a path separator, so your query is being interpreted as |
Yes, I figured that out but I think my original point still stands. |
Experimental branch has been working very well for me. I don't know what else you plan to do before merging it to master, but I'm gonna close this regardless. |
Here's an interesting case I came across where cpsm's scoring algorithm doesn't really do the right thing, but I think it should be easy enough to fix:
I have
g:cpsm_query_inverting_delimiter = ' '
. There is a filefoo/bar/graph/order.rb
. When I search cpsm withorder gra
that file is not the first match; the first match istmp/VZOCh7GJ4RUldAJOTIMRwSm0k8DmFMRexROl...
because if you'll note all of the necessary characters do appear in the correct order in that random string. The simple fix is to remove thetmp
directory from the ctrl-p search path but I think it also reveals that cpsm should be prioritizing matches somewhat based on contiguity of the match. The desired file matched the given query in two large chunks, whereas the tmp file matched 8 individual characters.The scorer already contains
parts
which is the number of path components... generalizing this to the number of contiguous match groups regardless of path componentization seems like a simple fix.The text was updated successfully, but these errors were encountered: