Search: better support of --disable-charset

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2013-09-06 13:27:50 +04:00
parent 66da276200
commit 941a1eac1d
7 changed files with 18 additions and 0 deletions

View File

@ -61,8 +61,10 @@ typedef struct mc_search_struct
{
/* public input data */
#ifdef HAVE_CHARSET
/* search in all charsets */
gboolean is_all_charsets;
#endif
/* case sensitive search */
gboolean is_case_sensitive;

View File

@ -258,7 +258,9 @@ dview_search_cmd (WDiff * dview)
return;
dview->search.handle->search_type = mcdiffview_search_options.type;
#ifdef HAVE_CHARSET
dview->search.handle->is_all_charsets = mcdiffview_search_options.all_codepages;
#endif
dview->search.handle->is_case_sensitive = mcdiffview_search_options.case_sens;
dview->search.handle->whole_words = mcdiffview_search_options.whole_words;

View File

@ -2527,7 +2527,9 @@ edit_replace_cmd (WEdit * edit, int again)
goto cleanup;
}
edit->search->search_type = edit_search_options.type;
#ifdef HAVE_CHARSET
edit->search->is_all_charsets = edit_search_options.all_codepages;
#endif
edit->search->is_case_sensitive = edit_search_options.case_sens;
edit->search->whole_words = edit_search_options.whole_words;
edit->search->search_fn = edit_search_cmd_callback;
@ -2729,7 +2731,9 @@ edit_search_cmd (WEdit * edit, gboolean again)
else
{
edit->search->search_type = edit_search_options.type;
#ifdef HAVE_CHARSET
edit->search->is_all_charsets = edit_search_options.all_codepages;
#endif
edit->search->is_case_sensitive = edit_search_options.case_sens;
edit->search->whole_words = edit_search_options.whole_words;
edit->search->search_fn = edit_search_cmd_callback;

View File

@ -170,7 +170,9 @@ editcmd_dialog_search_show (WEdit * edit)
if (edit->search != NULL)
{
edit->search->search_type = edit_search_options.type;
#ifdef HAVE_CHARSET
edit->search->is_all_charsets = edit_search_options.all_codepages;
#endif
edit->search->is_case_sensitive = edit_search_options.case_sens;
edit->search->whole_words = edit_search_options.whole_words;
edit->search->search_fn = edit_search_cmd_callback;

View File

@ -1632,12 +1632,16 @@ run_process (void)
options.content_regexp ? MC_SEARCH_T_REGEX : MC_SEARCH_T_NORMAL;
search_content_handle->is_case_sensitive = options.content_case_sens;
search_content_handle->whole_words = options.content_whole_words;
#ifdef HAVE_CHARSET
search_content_handle->is_all_charsets = options.content_all_charsets;
#endif
}
search_file_handle = mc_search_new (find_pattern, -1, NULL);
search_file_handle->search_type = options.file_pattern ? MC_SEARCH_T_GLOB : MC_SEARCH_T_REGEX;
search_file_handle->is_case_sensitive = options.file_case_sens;
#ifdef HAVE_CHARSET
search_file_handle->is_all_charsets = options.file_all_charsets;
#endif
search_file_handle->is_entire_line = options.file_pattern;
resuming = FALSE;

View File

@ -163,7 +163,9 @@ mcview_continue_search_cmd (mcview_t * view)
else
{
view->search->search_type = mcview_search_options.type;
#ifdef HAVE_CHARSET
view->search->is_all_charsets = mcview_search_options.all_codepages;
#endif
view->search->is_case_sensitive = mcview_search_options.case_sens;
view->search->whole_words = mcview_search_options.whole_words;
view->search->search_fn = mcview_search_cmd_callback;

View File

@ -151,7 +151,9 @@ mcview_dialog_search (mcview_t * view)
if (view->search != NULL)
{
view->search->search_type = mcview_search_options.type;
#ifdef HAVE_CHARSET
view->search->is_all_charsets = mcview_search_options.all_codepages;
#endif
view->search->is_case_sensitive = mcview_search_options.case_sens;
view->search->whole_words = mcview_search_options.whole_words;
view->search->search_fn = mcview_search_cmd_callback;