Ticket #400: 400-003-mcedit-make-it-possible-to-search-across-lines.patch

File 400-003-mcedit-make-it-possible-to-search-across-lines.patch, 3.8 KB (added by mooffie, 8 years ago)
  • src/editor/edit-impl.h

    From 9bcd991a5f7f76fc55f23083a4f777205dbc61ae Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Tue, 6 Dec 2016 22:28:26 +0200
    Subject: [PATCH 3/3] Ticket #400: mcedit: make it possible to search across
     lines.
    
    ---
     src/editor/edit-impl.h       | 1 +
     src/editor/editcmd.c         | 2 ++
     src/editor/editcmd_dialogs.c | 4 ++++
     3 files changed, 7 insertions(+)
    
    diff --git a/src/editor/edit-impl.h b/src/editor/edit-impl.h
    index 95f730d..204c79c 100644
    a b typedef struct edit_search_options_t 
    104104    gboolean backwards; 
    105105    gboolean only_in_selection; 
    106106    gboolean whole_words; 
     107    gboolean across_lines; 
    107108    gboolean all_codepages; 
    108109} edit_search_options_t; 
    109110 
  • src/editor/editcmd.c

    diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
    index 26aad03..5781545 100644
    a b edit_replace_cmd (WEdit * edit, gboolean again) 
    25812581#endif 
    25822582        edit->search->is_case_sensitive = edit_search_options.case_sens; 
    25832583        edit->search->whole_words = edit_search_options.whole_words; 
     2584        edit->search->slurp_mode = edit_search_options.across_lines; 
    25842585        edit->search->search_fn = edit_search_cmd_callback; 
    25852586        edit->search->update_fn = edit_search_update_callback; 
    25862587        edit->search_line_type = edit_get_search_line_type (edit->search); 
    edit_search_cmd (WEdit * edit, gboolean again) 
    28052806#endif 
    28062807                edit->search->is_case_sensitive = edit_search_options.case_sens; 
    28072808                edit->search->whole_words = edit_search_options.whole_words; 
     2809                edit->search->slurp_mode = edit_search_options.across_lines; 
    28082810                edit->search->search_fn = edit_search_cmd_callback; 
    28092811                edit->search->update_fn = edit_search_update_callback; 
    28102812                edit->search_line_type = edit_get_search_line_type (edit->search); 
  • src/editor/editcmd_dialogs.c

    diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c
    index 007e69a..d5ea604 100644
    a b edit_search_options_t edit_search_options = { 
    5555    .backwards = FALSE, 
    5656    .only_in_selection = FALSE, 
    5757    .whole_words = FALSE, 
     58    .across_lines = FALSE, 
    5859    .all_codepages = FALSE 
    5960}; 
    6061 
    editcmd_dialog_search_show (WEdit * edit) 
    113114                QUICK_CHECKBOX (N_("&Backwards"), &edit_search_options.backwards, NULL), 
    114115                QUICK_CHECKBOX (N_("In se&lection"), &edit_search_options.only_in_selection, NULL), 
    115116                QUICK_CHECKBOX (N_("&Whole words"), &edit_search_options.whole_words, NULL), 
     117                QUICK_CHECKBOX (N_("Acro&ss lines"), &edit_search_options.across_lines, NULL), 
    116118#ifdef HAVE_CHARSET 
    117119                QUICK_CHECKBOX (N_("&All charsets"), &edit_search_options.all_codepages, NULL), 
    118120#endif 
    editcmd_dialog_search_show (WEdit * edit) 
    175177#endif 
    176178        edit->search->is_case_sensitive = edit_search_options.case_sens; 
    177179        edit->search->whole_words = edit_search_options.whole_words; 
     180        edit->search->slurp_mode = edit_search_options.across_lines; 
    178181        edit->search->search_fn = edit_search_cmd_callback; 
    179182        edit->search->update_fn = edit_search_update_callback; 
    180183    } 
    editcmd_dialog_replace_show (WEdit * edit, const char *search_default, const cha 
    213216                QUICK_CHECKBOX (N_("&Backwards"), &edit_search_options.backwards, NULL), 
    214217                QUICK_CHECKBOX (N_("In se&lection"), &edit_search_options.only_in_selection, NULL), 
    215218                QUICK_CHECKBOX (N_("&Whole words"), &edit_search_options.whole_words, NULL), 
     219                QUICK_CHECKBOX (N_("Acro&ss lines"), &edit_search_options.across_lines, NULL), 
    216220#ifdef HAVE_CHARSET 
    217221                QUICK_CHECKBOX (N_("&All charsets"), &edit_search_options.all_codepages, NULL), 
    218222#endif