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 |
104 | 104 | gboolean backwards; |
105 | 105 | gboolean only_in_selection; |
106 | 106 | gboolean whole_words; |
| 107 | gboolean across_lines; |
107 | 108 | gboolean all_codepages; |
108 | 109 | } edit_search_options_t; |
109 | 110 | |
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) |
2581 | 2581 | #endif |
2582 | 2582 | edit->search->is_case_sensitive = edit_search_options.case_sens; |
2583 | 2583 | edit->search->whole_words = edit_search_options.whole_words; |
| 2584 | edit->search->slurp_mode = edit_search_options.across_lines; |
2584 | 2585 | edit->search->search_fn = edit_search_cmd_callback; |
2585 | 2586 | edit->search->update_fn = edit_search_update_callback; |
2586 | 2587 | edit->search_line_type = edit_get_search_line_type (edit->search); |
… |
… |
edit_search_cmd (WEdit * edit, gboolean again) |
2805 | 2806 | #endif |
2806 | 2807 | edit->search->is_case_sensitive = edit_search_options.case_sens; |
2807 | 2808 | edit->search->whole_words = edit_search_options.whole_words; |
| 2809 | edit->search->slurp_mode = edit_search_options.across_lines; |
2808 | 2810 | edit->search->search_fn = edit_search_cmd_callback; |
2809 | 2811 | edit->search->update_fn = edit_search_update_callback; |
2810 | 2812 | edit->search_line_type = edit_get_search_line_type (edit->search); |
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 = { |
55 | 55 | .backwards = FALSE, |
56 | 56 | .only_in_selection = FALSE, |
57 | 57 | .whole_words = FALSE, |
| 58 | .across_lines = FALSE, |
58 | 59 | .all_codepages = FALSE |
59 | 60 | }; |
60 | 61 | |
… |
… |
editcmd_dialog_search_show (WEdit * edit) |
113 | 114 | QUICK_CHECKBOX (N_("&Backwards"), &edit_search_options.backwards, NULL), |
114 | 115 | QUICK_CHECKBOX (N_("In se&lection"), &edit_search_options.only_in_selection, NULL), |
115 | 116 | QUICK_CHECKBOX (N_("&Whole words"), &edit_search_options.whole_words, NULL), |
| 117 | QUICK_CHECKBOX (N_("Acro&ss lines"), &edit_search_options.across_lines, NULL), |
116 | 118 | #ifdef HAVE_CHARSET |
117 | 119 | QUICK_CHECKBOX (N_("&All charsets"), &edit_search_options.all_codepages, NULL), |
118 | 120 | #endif |
… |
… |
editcmd_dialog_search_show (WEdit * edit) |
175 | 177 | #endif |
176 | 178 | edit->search->is_case_sensitive = edit_search_options.case_sens; |
177 | 179 | edit->search->whole_words = edit_search_options.whole_words; |
| 180 | edit->search->slurp_mode = edit_search_options.across_lines; |
178 | 181 | edit->search->search_fn = edit_search_cmd_callback; |
179 | 182 | edit->search->update_fn = edit_search_update_callback; |
180 | 183 | } |
… |
… |
editcmd_dialog_replace_show (WEdit * edit, const char *search_default, const cha |
213 | 216 | QUICK_CHECKBOX (N_("&Backwards"), &edit_search_options.backwards, NULL), |
214 | 217 | QUICK_CHECKBOX (N_("In se&lection"), &edit_search_options.only_in_selection, NULL), |
215 | 218 | QUICK_CHECKBOX (N_("&Whole words"), &edit_search_options.whole_words, NULL), |
| 219 | QUICK_CHECKBOX (N_("Acro&ss lines"), &edit_search_options.across_lines, NULL), |
216 | 220 | #ifdef HAVE_CHARSET |
217 | 221 | QUICK_CHECKBOX (N_("&All charsets"), &edit_search_options.all_codepages, NULL), |
218 | 222 | #endif |