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) |
879 | 879 | { |
880 | 880 | search_end = search_start + edit->search->original_len; |
881 | 881 | } |
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)) |
884 | 883 | { |
885 | | return TRUE; |
| 884 | if (edit->search->normal_offset == search_start) |
| 885 | return TRUE; |
886 | 886 | } |
887 | | |
| 887 | else if (edit->search->error == MC_SEARCH_E_ABORT) |
| 888 | return FALSE; |
888 | 889 | |
889 | 890 | if ((edit->search_line_type & AT_START_LINE) != 0) |
890 | 891 | search_start = |