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

Pass 'nosort' parameter to external match function #359

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pjkack
Copy link

@pjkack pjkack commented Apr 8, 2017

I have implemented my own match function, and I need to know when I can safely sort the results and not.

pjkack added 2 commits April 8, 2017 20:05
Plugins can disable sorting by setting 'sort' option to 0.
Ctrlp can disable sorting internally, e.g. for the mru list.
Pass this information to external match function.
@mattn
Copy link
Member

mattn commented Apr 26, 2017

Do not merge. This break using third party matcher. ex: cspm.

@pjkack
Copy link
Author

pjkack commented Apr 26, 2017

You are right. This was a terrible change, and I'm sorry for it. I was so careful to not break anything regarding the actual logic so I forgot that the extra parameter in the normal function call will break it all. Do you have a good idea how to achieve this? I still think it would be good to forward this information to third party matchers like mine, cspm or py-matcher. The buf and mru already have a good item order that I would like to maintain.

@mattn
Copy link
Member

mattn commented Apr 26, 2017

Don't mind about my comment. This repository have few commiters. So I did let them known to not merge this change until fix. :)

The extra argument breaks backwards compatibility with other matchers.
Only pass nosort when matcher function is called with a dictionary.
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

Successfully merging this pull request may close these issues.

2 participants