Skip to content
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

g:ctrlp_by_filename doesn't work #37

Open
12425 opened this issue May 17, 2017 · 2 comments
Open

g:ctrlp_by_filename doesn't work #37

12425 opened this issue May 17, 2017 · 2 comments

Comments

@12425
Copy link

12425 commented May 17, 2017

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
Copy link
Author

12425 commented May 17, 2017

A PR is created at #38.

@tracyone
Copy link

tracyone commented Jan 6, 2018

I can reproduce this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants