-
Notifications
You must be signed in to change notification settings - Fork 3
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
Viewer doesn't show search error messages #3720
Comments
|
|
Explanation for the patch:
The main problem(s) are in mcview_do_search().
mcview_do_search() has the following structure:
There are two bugs here:
(1) The test view->search->error == MC_SEARCH_E_ABORT || view->search->error == MC_SEARCH_E_NOTFOUND checks for only two of the three possibilities of the failure of mc_search_run(), as documented in the patch at #3693. This test precludes other error codes, like invalid pattern. The fix is simply to remove this test altogether.
(2) We start a "Continue from beginning?"-search even if the failure was because of pattern error or user abort. Instead, we should do this only if the failure was of the MC_SEARCH_E_NOTFOUND kind. Otherwise, besides doing the wrong thing, we also may obliterate a useful error message.
There's also a bug in the backwards search, in mcview_find():
The backwards search, in mcview_find(), works as follows:
(3) The "abort" should occur for any error other than MC_SEARCH_E_NOTFOUND, not just for interactive user abort.
(BTW, a similar bug perhaps exists in the backwards search in the editor. I'll check this out and start a new ticket if that's the case.) |
Branch: 3720_mcview_search_error_messages |
|
|
Important
This issue was migrated from Trac:
mooffie
(@mooffie)For example, when searching (F7) using an invalid regexp pattern (say "*" or "["), we aren't shown an appropriate error message telling us the pattern is bad. The editor does show such error messages.
(The only "error" message the viewer shows is "Search string not found".)
Note
Original attachments:
mooffie
(@mooffie) onNov 12, 2016 at 21:21 UTC
The text was updated successfully, but these errors were encountered: