mirror of https://github.com/MidnightCommander/mc
quicksearch: stop appending of chars if no file found
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
38008d6580
commit
7e8975e022
12
src/screen.c
12
src/screen.c
|
@ -2199,6 +2199,7 @@ do_search (WPanel *panel, int c_code)
|
|||
char *act;
|
||||
mc_search_t *search;
|
||||
char *reg_exp;
|
||||
gboolean is_found = FALSE;
|
||||
|
||||
l = strlen (panel->search_buffer);
|
||||
if (c_code == KEY_BACKSPACE) {
|
||||
|
@ -2249,9 +2250,20 @@ do_search (WPanel *panel, int c_code)
|
|||
if (mc_search_run (search, panel->dir.list[i].fname,
|
||||
0, panel->dir.list[i].fnamelen, NULL)) {
|
||||
sel = i;
|
||||
is_found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (! is_found) {
|
||||
if (c_code != KEY_BACKSPACE) {
|
||||
act = panel->search_buffer + l;
|
||||
str_prev_noncomb_char (&act, panel->search_buffer);
|
||||
act[0] = '\0';
|
||||
}
|
||||
mc_search_free (search);
|
||||
g_free (reg_exp);
|
||||
return;
|
||||
}
|
||||
|
||||
unselect_item (panel);
|
||||
panel->selected = sel;
|
||||
|
|
Loading…
Reference in New Issue