ctrlp-py-matcher icon indicating copy to clipboard operation
ctrlp-py-matcher copied to clipboard

g:ctrlp_by_filename doesn't work

Open 12425 opened this issue 8 years ago • 2 comments

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

  1. End with [^/]$
  2. 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.

12425 avatar May 17 '17 07:05 12425

A PR is created at #38.

12425 avatar May 17 '17 07:05 12425

I can reproduce this issue

tracyone avatar Jan 06 '18 11:01 tracyone