| File src/filelist.c changed (mode: 100644) (index ae3a9111d..55c2e6e03) |
| ... |
... |
add_directory_leaf(view_t *view, const char path[], int parent_pos) |
| 4476 |
4476 |
|
|
| 4477 |
4477 |
/* If local filter isn't empty, assume that user is looking for something and |
/* If local filter isn't empty, assume that user is looking for something and |
| 4478 |
4478 |
* leafs will get in his way. */ |
* leafs will get in his way. */ |
| 4479 |
|
if(!filter_is_empty(&view->local_filter.filter)) |
|
|
4479 |
|
if(!local_filter_is_empty(view)) |
| 4480 |
4480 |
{ |
{ |
| 4481 |
4481 |
return 0; |
return 0; |
| 4482 |
4482 |
} |
} |
| File src/filtering.c changed (mode: 100644) (index 7addd527c..927be6259) |
| ... |
... |
filters_drop_temporaries(view_t *view, dir_entry_t entries[]) |
| 385 |
385 |
view->list_rows = list_size; |
view->list_rows = list_size; |
| 386 |
386 |
} |
} |
| 387 |
387 |
|
|
|
388 |
|
int |
|
389 |
|
local_filter_is_empty(const view_t *view) |
|
390 |
|
{ |
|
391 |
|
return filter_is_empty(&view->local_filter.filter); |
|
392 |
|
} |
|
393 |
|
|
| 388 |
394 |
int |
int |
| 389 |
395 |
local_filter_set(view_t *view, const char filter[]) |
local_filter_set(view_t *view, const char filter[]) |
| 390 |
396 |
{ |
{ |
| |
| ... |
... |
load_unfiltered_list(view_t *view) |
| 476 |
482 |
static int |
static int |
| 477 |
483 |
list_is_incomplete(view_t *view) |
list_is_incomplete(view_t *view) |
| 478 |
484 |
{ |
{ |
| 479 |
|
if(view->filtered > 0 && !filter_is_empty(&view->local_filter.filter)) |
|
|
485 |
|
if(view->filtered > 0 && !local_filter_is_empty(view)) |
| 480 |
486 |
{ |
{ |
| 481 |
487 |
return 1; |
return 1; |
| 482 |
488 |
} |
} |
| |
| ... |
... |
update_filtering_lists(view_t *view, int add, int clear) |
| 554 |
560 |
} |
} |
| 555 |
561 |
continue; |
continue; |
| 556 |
562 |
} |
} |
| 557 |
|
else if(!filter_is_empty(&view->local_filter.filter)) |
|
|
563 |
|
else if(!local_filter_is_empty(view)) |
| 558 |
564 |
{ |
{ |
| 559 |
565 |
if(clear) |
if(clear) |
| 560 |
566 |
{ |
{ |
| |
| ... |
... |
local_filter_update_view(view_t *view, int rel_pos) |
| 712 |
718 |
if(pos >= 0) |
if(pos >= 0) |
| 713 |
719 |
{ |
{ |
| 714 |
720 |
if(pos == 0 && is_parent_dir(view->dir_entry[0].name) && |
if(pos == 0 && is_parent_dir(view->dir_entry[0].name) && |
| 715 |
|
view->list_rows > 1 && !filter_is_empty(&view->local_filter.filter)) |
|
|
721 |
|
view->list_rows > 1 && !local_filter_is_empty(view)) |
| 716 |
722 |
{ |
{ |
| 717 |
723 |
++pos; |
++pos; |
| 718 |
724 |
} |
} |
| File src/filtering.h changed (mode: 100644) (index e88bcd17d..ff1c36659) |
| ... |
... |
void name_filters_restore(struct view_t *view); |
| 89 |
89 |
|
|
| 90 |
90 |
/* Local filter related functions. */ |
/* Local filter related functions. */ |
| 91 |
91 |
|
|
|
92 |
|
/* Checks whether the view has an empty (unset) local filter. Returns non-zero |
|
93 |
|
* if so, otherwise zero is returned. */ |
|
94 |
|
int local_filter_is_empty(const struct view_t *view); |
|
95 |
|
|
| 92 |
96 |
/* Sets regular expression of the local filter for the view. First call of this |
/* Sets regular expression of the local filter for the view. First call of this |
| 93 |
97 |
* function initiates filter set process, which should be ended by call to |
* function initiates filter set process, which should be ended by call to |
| 94 |
98 |
* local_filter_accept() or local_filter_cancel(). Returns zero if not all |
* local_filter_accept() or local_filter_cancel(). Returns zero if not all |
| File src/sort.c changed (mode: 100644) (index 7398c098d..d847c2801) |
| ... |
... |
sort_view(view_t *v) |
| 169 |
169 |
/* When local filter isn't empty, parent directories disappear and sorting |
/* When local filter isn't empty, parent directories disappear and sorting |
| 170 |
170 |
* stops being aware of tree structure to some degree. Perform one more round |
* stops being aware of tree structure to some degree. Perform one more round |
| 171 |
171 |
* of stable sorting of origins to group child nodes. */ |
* of stable sorting of origins to group child nodes. */ |
| 172 |
|
if(!filter_is_empty(&v->local_filter.filter)) |
|
|
172 |
|
if(!local_filter_is_empty(v)) |
| 173 |
173 |
{ |
{ |
| 174 |
174 |
flist_custom_uncompress_tree(v); |
flist_custom_uncompress_tree(v); |
| 175 |
175 |
} |
} |
| |
| ... |
... |
sort_view(view_t *v) |
| 198 |
198 |
/* Done with linking data by now. */ |
/* Done with linking data by now. */ |
| 199 |
199 |
cleanup_linking(); |
cleanup_linking(); |
| 200 |
200 |
|
|
| 201 |
|
if(filter_is_empty(&v->local_filter.filter)) |
|
|
201 |
|
if(local_filter_is_empty(v)) |
| 202 |
202 |
{ |
{ |
| 203 |
203 |
dynarray_free(unsorted_list); |
dynarray_free(unsorted_list); |
| 204 |
204 |
} |
} |
| File tests/misc/compare_misc.c changed (mode: 100644) (index 026c76ae6..f629ff8cd) |
| ... |
... |
TEST(local_filter_is_not_set) |
| 220 |
220 |
compare_two_panes(CT_NAME, LT_ALL, CF_SHOW); |
compare_two_panes(CT_NAME, LT_ALL, CF_SHOW); |
| 221 |
221 |
|
|
| 222 |
222 |
cmds_dispatch1("f", &lwin, CIT_FILTER_PATTERN); |
cmds_dispatch1("f", &lwin, CIT_FILTER_PATTERN); |
| 223 |
|
assert_true(filter_is_empty(&lwin.local_filter.filter)); |
|
|
223 |
|
assert_true(local_filter_is_empty(&lwin)); |
| 224 |
224 |
|
|
| 225 |
225 |
modcline_enter(CLS_FILTER, lwin.local_filter.filter.raw); |
modcline_enter(CLS_FILTER, lwin.local_filter.filter.raw); |
| 226 |
226 |
assert_true(vle_mode_is(NORMAL_MODE)); |
assert_true(vle_mode_is(NORMAL_MODE)); |
| File tests/misc/flist_custom.c changed (mode: 100644) (index ab1aa67fd..7a9503842) |
| ... |
... |
TEST(custom_view_does_not_reset_local_state) |
| 385 |
385 |
assert_int_equal(-SK_BY_TARGET, lwin.sort[0]); |
assert_int_equal(-SK_BY_TARGET, lwin.sort[0]); |
| 386 |
386 |
setup_custom_view(&lwin, very); |
setup_custom_view(&lwin, very); |
| 387 |
387 |
assert_int_equal(very ? SK_NONE : -SK_BY_TARGET, lwin.sort[0]); |
assert_int_equal(very ? SK_NONE : -SK_BY_TARGET, lwin.sort[0]); |
| 388 |
|
assert_false(filter_is_empty(&lwin.local_filter.filter)); |
|
|
388 |
|
assert_false(local_filter_is_empty(&lwin)); |
| 389 |
389 |
|
|
| 390 |
390 |
cdt.entry = &lwin.dir_entry[0]; |
cdt.entry = &lwin.dir_entry[0]; |
| 391 |
391 |
cdt.line_hi_group = 1; |
cdt.line_hi_group = 1; |
| |
| ... |
... |
TEST(custom_view_does_not_reset_local_state) |
| 400 |
400 |
|
|
| 401 |
401 |
/* Nor on leaving it. */ |
/* Nor on leaving it. */ |
| 402 |
402 |
assert_int_equal(very ? -SK_BY_TARGET : -SK_BY_TYPE, lwin.sort[0]); |
assert_int_equal(very ? -SK_BY_TARGET : -SK_BY_TYPE, lwin.sort[0]); |
| 403 |
|
assert_false(filter_is_empty(&lwin.local_filter.filter)); |
|
|
403 |
|
assert_false(local_filter_is_empty(&lwin)); |
| 404 |
404 |
|
|
| 405 |
405 |
cdt.line_hi_group = 2; |
cdt.line_hi_group = 2; |
| 406 |
406 |
columns_format_line(lwin.columns, &cdt, MAX_WIDTH); |
columns_format_line(lwin.columns, &cdt, MAX_WIDTH); |
| File tests/misc/navigation.c changed (mode: 100644) (index 48609813b..191a547d5) |
| ... |
... |
TEST(local_filter_is_reset_in_cv_to_follow_mark) |
| 71 |
71 |
assert_success(marks_goto(&lwin, 'a')); |
assert_success(marks_goto(&lwin, 'a')); |
| 72 |
72 |
|
|
| 73 |
73 |
assert_true(flist_custom_active(&lwin)); |
assert_true(flist_custom_active(&lwin)); |
| 74 |
|
assert_true(filter_is_empty(&lwin.local_filter.filter)); |
|
|
74 |
|
assert_true(local_filter_is_empty(&lwin)); |
| 75 |
75 |
} |
} |
| 76 |
76 |
|
|
| 77 |
77 |
TEST(following_resets_cv) |
TEST(following_resets_cv) |