mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-30 03:32:53 +03:00
Merge branch '2022_case_sensitive_quick_search'
* 2022_case_sensitive_quick_search: Added description of Quick search modes. Ticket #2022 (case sensitive quick search)
This commit is contained in:
commit
1445e6b59f
@ -595,6 +595,15 @@ again, the next match is searched for.
|
||||
.P
|
||||
Besides the filename characters, you can also use wildcard
|
||||
characters '*' and '?'.
|
||||
.P
|
||||
Quick search mode is defined by
|
||||
.I quick_search_case_sensitive
|
||||
option located in [Midnight-Commander] section in configuration file.
|
||||
This option can have one of the following values: 0, 1 or 2.
|
||||
If quick_search_case_sensitive=0, quick search is case insensitive.
|
||||
If quick_search_case_sensitive=1, quick search is case sensitive.
|
||||
If quick_search_case_sensitive=2 (default value), quick search mode
|
||||
is matched to the the panel sort order: case sensitive or not.
|
||||
.\"NODE " Shell Command Line"
|
||||
.SH " Shell Command Line"
|
||||
This section lists keys which are useful to avoid excessive typing when
|
||||
|
@ -597,6 +597,16 @@ Midnight Commander\-а. Для возврата к вашему приложен
|
||||
.P
|
||||
Кроме обычных символов в имени файла также можно использовать
|
||||
символы маски '*' и '?'.
|
||||
.P
|
||||
Режим быстрого поиска определяется параметром
|
||||
.I quick_search_case_sensitive
|
||||
который должен располагаться в секции [Midnight-Commander] конфигурационного
|
||||
файла. Этот параметр может иметь одно из следующих значений: 0, 1 или 2.
|
||||
Если quick_search_case_sensitive=0, при быстром поиске не учитывается
|
||||
регистр имён файлов. Если quick_search_case_sensitive=1, регистр имён файлов
|
||||
учитывается. Если quick_search_case_sensitive=2 (значение по умолчанию),
|
||||
режим быстрого поиска соответствует порядку сортировки в панели: с учётом
|
||||
регистра или без.
|
||||
.\"NODE " Shell Command Line"
|
||||
.SH " Командная строка оболочки"
|
||||
В этом разделе перечислены команды, которые позволяют сократить число
|
||||
|
@ -44,6 +44,8 @@ extern int mouse_move_pages;
|
||||
|
||||
extern int option_tab_spacing;
|
||||
|
||||
extern int quick_search_case_sensitive;
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
extern int source_codepage;
|
||||
extern int default_source_codepage;
|
||||
|
22
src/screen.c
22
src/screen.c
@ -89,6 +89,14 @@ typedef struct format_e
|
||||
const char *id;
|
||||
} format_e;
|
||||
|
||||
enum {
|
||||
QSEARCH_CASE_INSENSITIVE = 0, /* quick search in case insensitive mode */
|
||||
QSEARCH_CASE_SENSITIVE = 1, /* quick search in case sensitive mode */
|
||||
QSEARCH_PANEL_CASE = 2 /* quick search get value from panel case_sensitive */
|
||||
};
|
||||
|
||||
int quick_search_case_sensitive = QSEARCH_PANEL_CASE;
|
||||
|
||||
/* If true, show the mini-info on the panel */
|
||||
int show_mini_info = 1;
|
||||
|
||||
@ -2403,8 +2411,18 @@ do_search (WPanel * panel, int c_code)
|
||||
search = mc_search_new (esc_str, -1);
|
||||
search->search_type = MC_SEARCH_T_GLOB;
|
||||
search->is_entire_line = TRUE;
|
||||
search->is_case_sentitive = 0;
|
||||
|
||||
switch (quick_search_case_sensitive)
|
||||
{
|
||||
case QSEARCH_CASE_SENSITIVE:
|
||||
search->is_case_sentitive = TRUE;
|
||||
break;
|
||||
case QSEARCH_CASE_INSENSITIVE:
|
||||
search->is_case_sentitive = FALSE;
|
||||
break;
|
||||
default:
|
||||
search->is_case_sentitive = panel->case_sensitive;
|
||||
break;
|
||||
}
|
||||
sel = panel->selected;
|
||||
for (i = panel->selected; !wrapped || i != panel->selected; i++)
|
||||
{
|
||||
|
@ -232,6 +232,7 @@ static const struct {
|
||||
{ "reverse_files_only", &reverse_files_only },
|
||||
{ "copymove_persistent_attr", &setup_copymove_persistent_attr },
|
||||
{ "select_flags", &select_flags },
|
||||
{ "quick_search_case_sensitive", &quick_search_case_sensitive },
|
||||
{ 0, 0 }
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
Loading…
x
Reference in New Issue
Block a user