Ticket #3648: mc-3648-03-handle-user-abort-on-backwards-edit-search.patch

File mc-3648-03-handle-user-abort-on-backwards-edit-search.patch, 1.4 KB (added by and, 6 years ago)
  • src/editor/editcmd.c

    From a36b410b4368745011f683421d24cc22d13fd624 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sat, 21 May 2016 14:31:38 +0000
    Subject: [PATCH] Handle user abort on backwards edit search
    
    Currently backwards edit search loops mc_search_run() until match or search end,
    but not on user abort request.
    
    Respect newly introduced MC_SEARCH_E_ABORT error status
    and exit backwards search loop on user request.
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/editor/editcmd.c | 9 +++++----
     1 file changed, 5 insertions(+), 4 deletions(-)
    
    diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
    index d1aa93d..401246e 100644
    a b editcmd_find (edit_search_status_msg_t * esm, gsize * len) 
    879879            { 
    880880                search_end = search_start + edit->search->original_len; 
    881881            } 
    882             if (mc_search_run (edit->search, (void *) esm, search_start, search_end, len) 
    883                 && edit->search->normal_offset == search_start) 
     882            if (mc_search_run (edit->search, (void *) esm, search_start, search_end, len)) 
    884883            { 
    885                 return TRUE; 
     884                if (edit->search->normal_offset == search_start) 
     885                    return TRUE; 
    886886            } 
    887  
     887            else if (edit->search->error == MC_SEARCH_E_ABORT) 
     888                return FALSE; 
    888889 
    889890            if ((edit->search_line_type & AT_START_LINE) != 0) 
    890891                search_start =