-
Notifications
You must be signed in to change notification settings - Fork 22
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
Present errors to user in helpful way #10
Labels
Comments
Merged #14 into this as it's another class of the same underlying issue. |
wincent
added a commit
that referenced
this issue
Jul 24, 2015
This is the first step in better error message support. At the moment we show a "no results" error when there are no results (fixes #14), and for other errors (ie. when every line in the result is "invalid", which basically means that the command failed), we show the error text (partial fix for #10). Note that actually getting messages to stay on screen is non-trivial in Vim (see inline comments), so we end up using `input()` to force things. It seems to be the only way that reliably works across the board (with and without vim-dispatch). Still to do: smart heuristics to provide better messages when people make common mistakes, like misguidedly trying to wrap their search pattern in quotes.
wincent
added a commit
that referenced
this issue
Jul 24, 2015
Help users see the errors of their ways: - searching for '"foo"' or "'foo'" will tend not to find what you're looking for, unless you literally meant "look for the string 'foo', surround by quotes" - searching for '"foo bar"' is not the right way to deal with spaces; show a hint and link to the docs Note that we also show the failed search pattern, which may be useful for catching other classes of errors. Fixes: #10
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Forking this from #1).
We should catch some common classes of errors and show the user a helpful warning in the quickfix listing.
:Ack foo bar
):Ack 'foo bar'
or:Ack "foo bar"
)Both of those are going to produce errors like:
Another mistake would be the non-space case (
:Ack 'foo'
). That won't run into astat
error, but it won't find "foo" either (it's looking for single quote followed by "foo" followed by single quote).The problem with catching
stat
errors is they'll likely be slightly different from platform to platform, so we need to find the right way to detect them without risking false positives (alas, we don't necessarily get access to the exit status of the underlying process).As for catching errors for the
'foo'
case, we can probably just consider it an error whenever a search is wrapped in quotes and doesn't return any results.The text was updated successfully, but these errors were encountered: