From 38b96be73707ae6d945e3a0ee7ac1c480c1f641d Mon Sep 17 00:00:00 2001 From: Mooffie Date: Thu, 10 Nov 2016 22:45:16 +0200 Subject: [PATCH] Ticket #3720: make viewer show search error messages. Signed-off-by: Andrew Borodin --- src/viewer/search.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/viewer/search.c b/src/viewer/search.c index fc7efab1d..42e349bb1 100644 --- a/src/viewer/search.c +++ b/src/viewer/search.c @@ -153,8 +153,9 @@ mcview_find (mcview_search_status_msg_t * ssm, off_t search_start, off_t search_ return TRUE; } - /* Abort search. */ - if (!ok && view->search->error == MC_SEARCH_E_ABORT) + /* We abort the search in case of a pattern error, or if the user aborts + the search. In other words: in all cases except "string not found". */ + if (!ok && view->search->error != MC_SEARCH_E_NOTFOUND) return FALSE; search_start--; @@ -374,7 +375,8 @@ mcview_do_search (WView * view, off_t want_search_start) status_msg_deinit (STATUS_MSG (&vsm)); - if (orig_search_start != 0 && !found && !mcview_search_options.backwards) + if (orig_search_start != 0 && (!found && view->search->error == MC_SEARCH_E_NOTFOUND) + && !mcview_search_options.backwards) { view->search_start = orig_search_start; mcview_update (view); @@ -406,9 +408,7 @@ mcview_do_search (WView * view, off_t want_search_start) } } - if (!found - && (view->search->error == MC_SEARCH_E_ABORT - || view->search->error == MC_SEARCH_E_NOTFOUND)) + if (!found) { view->search_start = orig_search_start; mcview_update (view);