Closed eapache closed 8 years ago
A query-inverting delimiter doesn't imply a path separator, so your query is being interpreted as graorder
; order gr/
should give you much better results.
Yes, I figured that out but I think my original point still stands. graorder
matched in two contiguous chunks should score better than another match across eight discontinuous letters.
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.