Ticket #3720: 3720-make-viewer-show-search-error-messages.patch

File 3720-make-viewer-show-search-error-messages.patch, 1.7 KB (added by mooffie, 8 years ago)
  • src/viewer/search.c

    From 7bc2ca096da059736ebf741d70211196174ca52b Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Thu, 10 Nov 2016 22:45:16 +0200
    Subject: [PATCH] Ticket #3720: make viewer show search error messages.
    
    ---
     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 fc7efab..42e349b 100644
    a b mcview_find (mcview_search_status_msg_t * ssm, off_t search_start, off_t search_ 
    153153                return TRUE; 
    154154            } 
    155155 
    156             /* Abort search. */ 
    157             if (!ok && view->search->error == MC_SEARCH_E_ABORT) 
     156            /* We abort the search in case of a pattern error, or if the user aborts 
     157               the search. In other words: in all cases except "string not found". */ 
     158            if (!ok && view->search->error != MC_SEARCH_E_NOTFOUND) 
    158159                return FALSE; 
    159160 
    160161            search_start--; 
    mcview_do_search (WView * view, off_t want_search_start) 
    374375 
    375376    status_msg_deinit (STATUS_MSG (&vsm)); 
    376377 
    377     if (orig_search_start != 0 && !found && !mcview_search_options.backwards) 
     378    if (orig_search_start != 0 && (!found && view->search->error == MC_SEARCH_E_NOTFOUND) 
     379        && !mcview_search_options.backwards) 
    378380    { 
    379381        view->search_start = orig_search_start; 
    380382        mcview_update (view); 
    mcview_do_search (WView * view, off_t want_search_start) 
    406408        } 
    407409    } 
    408410 
    409     if (!found 
    410         && (view->search->error == MC_SEARCH_E_ABORT 
    411             || view->search->error == MC_SEARCH_E_NOTFOUND)) 
     411    if (!found) 
    412412    { 
    413413        view->search_start = orig_search_start; 
    414414        mcview_update (view);