-
Notifications
You must be signed in to change notification settings - Fork 395
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
Comments
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. |
I'm not using dispatch |
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. |
Relevant 😞 : mhinz/vim-grepper@c345137 |
Current behaviour: If no matches are found, an empty result list is displayed.
My suggestion: Show a message like "No matches found for <pattern>".
The text was updated successfully, but these errors were encountered: