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

Show message if no matches found #167

Open
jonashaag opened this issue Oct 6, 2015 · 4 comments
Open

Show message if no matches found #167

jonashaag opened this issue Oct 6, 2015 · 4 comments

Comments

@jonashaag
Copy link

jonashaag commented Oct 6, 2015

Current behaviour: If no matches are found, an empty result list is displayed.
My suggestion: Show a message like "No matches found for <pattern>".

@ches
Copy link
Collaborator

ches commented Jun 16, 2016

I agree this would be a nicer experience.

One of the problems that makes this less simple than it might seem is that, if you're using ack.vim's support for Dispatch.vim to search asynchronously, I believe there's no way of knowing when the search is finished and Dispatch has the quickfix list ready. If we knew that then we could check if the list is empty before displaying it.

I may be misunderstanding that—there is an event fired, but I think it only works if the quickfix is eagerly displayed before results are ready, you can't wait to decide whether to display the list at all. This is how ack.vim behaves already when using Dispatch because of this limitation. We could subsequently hide the list if it turns out to be empty, and I'm okay with that, but it's kinda janky.

I'll try to take a further look at this, because I haven't confirmed it.

So if you're not using Dispatch, this should be easy to implement. But if you are, it's not, and having the plugin cleanly handle both cases with near-uniformity isn't something I've worked out yet.

@jonashaag
Copy link
Author

I'm not using dispatch

@ches
Copy link
Collaborator

ches commented Jun 17, 2016

But other people are (including myself), so my point is that a solution needs to support both cases without becoming too much of a mess to maintain.

It would be a nice UX improvement, but it's not actually broken behavior and most of the time I think people search for a term they're already looking at, so empty results are fairly rare. So I'm not really willing to introduce a lot of messy code for the small improvement, only if it's clean.

@ches
Copy link
Collaborator

ches commented Jun 17, 2016

Relevant 😞 : mhinz/vim-grepper@c345137

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

No branches or pull requests

2 participants