Skip to content

filter duplicates on g:ctrlp_lines while preserving order #367

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

Closed
wants to merge 2 commits into from

Conversation

timfeirg
Copy link

@timfeirg timfeirg commented May 21, 2017

This closes #314, #168

This may not be the best implementation, but it should only affect performance when refreshing a very large :CtrlPMixed lists.

I have very little experience with vimL, the project code hasn't been easy for me to understand, I'm not very sure where and how to implement this at all, I'll be glad to take any advises and fix up my commit.

@mattn

@tacahiroy
Copy link
Member

hmm - i still don't reproduce the issue actually

@timfeirg
Copy link
Author

timfeirg commented May 23, 2017

This would appear when one file appears in both files and MRU files at the same time.

steps to reproduce:

  • navigate to a brand new directory with some files, not cached by ctrlp (or simply :CtrlPClearAllCaches)
  • open up vim with ctrlp loaded
  • :CtrlpMixed and open up one of the files
  • re-open vim and launch :CtrlpMixed again, the file from the previous step will be duplicated, one from MRU, one from buffer.

image

I can firmly reproduce using the above steps.

@tacahiroy

@mattn
Copy link
Member

mattn commented May 24, 2017

Current implementation doesn't remove duplicates.

mattn added a commit that referenced this pull request May 24, 2017
mattn added a commit that referenced this pull request May 24, 2017
@timfeirg timfeirg force-pushed the master branch 2 times, most recently from 8e61364 to e4d8ccb Compare May 26, 2017 04:16
@timfeirg
Copy link
Author

I've been using my own fork without a problem, didn't notice any performance regression, would you be interested in merging this PR? I mean, until a better implementation is introduced? @mattn

I think it's probably best to filter out duplicates just before the ctrlp pane is rendered, but I haven't been able to pinpoint the code that does this.

@mattn
Copy link
Member

mattn commented May 26, 2017

I want to look your diff. And figure out what is problem.

@timfeirg
Copy link
Author

Dear developers, since #370 couldn't resolve this issue, would you be interested in merging this PR for the time being? We can, of course, revert this PR when a better implementation can be introduced.

Without duplicate filtering, :CtrlPMixed could display quite a lot of useless information, considering the default ctrlp pane is only 10 lines long, this behavior is very much wanted.

@mattn

@mattn
Copy link
Member

mattn commented Jun 19, 2018

Before merging, I want to reproduce this.

@timfeirg
Copy link
Author

I'm on e66b5b5 and I can still reproduce this following the steps in #367 (comment)

To fix expression in the help doc for more clarity.
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.

:CtrlPMixed doesn't detect duplicates
3 participants