ctrlp-py-matcher
ctrlp-py-matcher copied to clipboard
g:ctrlp_by_filename doesn't work
Explanation of g:ctrlp_by_filename:
*'g:ctrlp_by_filename'*
Set this to 1 to set searching by filename (as opposed to full path) as the
default: >
let g:ctrlp_by_filename = 0
To match filename only, the regex should
- End with
[^/]$ - No
/matches between input letters
Now I see the code is
if a:mmode == 'filename-only'
let s:matchregex .= '[\^\\]*'
endif
If I input a, the regex will be \v\c[\^\\]*a
This is not correct.
The correct regex should be \v\ca[^/]*$
In Windows it should be \v\ca[^\\]*$
If I input ab, the regex will be \v\c[\^\\]*a[^a]*b
And it should be \v\ca[^a/]*b[^/]*$ to avoid / between a and b.
A PR is created at #38.
I can reproduce this issue