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

Search for a phrase through entire file path not only buffer name #89

Open
farynaio opened this issue Oct 29, 2020 · 5 comments
Open

Search for a phrase through entire file path not only buffer name #89

farynaio opened this issue Oct 29, 2020 · 5 comments

Comments

@farynaio
Copy link

Is it possible to make ivy-rich search for a phrase through entire file path not only buffer name?

@Yevgnen
Copy link
Owner

Yevgnen commented Nov 3, 2020

As noted in README and #28, I'm afraid it is not possible to find an easy solution currently. But there's some efforts tried by the community. If anyone has suggestions on this, I'm glad to work on it.

@publicimageltd
Copy link

I'd be also interesting in matching the path (in ivy-switch-buffer), and also the project name. Looking at the code, I do not understand how the matching actually works. It looks like ivy will match the whole string, but then why is ivy-rich only matching against the buffer name? Is there some alist magic somewhere, mapping the buffer name to a display string? I think the easiest way to allow matching more than the buffer name would be to simply match everything in the whole line, and I have problems understanding why that should be a problem.

@Yevgnen
Copy link
Owner

Yevgnen commented Jan 8, 2021

@publicimageltd Hi, ivy-rich does not do any 'match' and just use ivy's transformer mechanism to display strings (So ivy knows nothing about whatever being added to the candidate). 😅Due to my limited Elisp knowledge, you may need to dig into how ivy matches, displays and highlights matches. (My best guess is: how it matches and highlights matches are two different things. And candidates are filtered and fixed before they are transformed, otherwise, it may cause some infinite loop if filtering happens again after they are transformed because again these transformed candidates need to be transformed).

@publicimageltd
Copy link

Thanks, I might take the time to find out how ivy does that.

@cjauvin
Copy link

cjauvin commented Nov 22, 2021

I have proposed a simple modification to ivy which allows to filter based on additional columns supplied by ivy-rich (or any user-supplied transformer function), on a per-command basis (i.e. in my personal case I use it only to modify the behavior of ivy-switch-buffer, as the extra cost of computing the transformations on the fly is low enough to be acceptable, which might not be the case with other functions).

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

4 participants