Skip to content

g:ctrlp_by_filename doesn't work #37

@12425

Description

@12425

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions