|
6 | 6 |
|
7 | 7 | ############################################################################## |
8 | 8 | # Python imports. |
| 9 | +from collections.abc import Iterable |
9 | 10 | from dataclasses import dataclass |
10 | 11 | from datetime import datetime |
11 | 12 | from pathlib import Path |
12 | | -from typing import ClassVar, Iterable, NamedTuple, Optional |
| 13 | +from typing import ClassVar, Final, NamedTuple, Optional |
13 | 14 |
|
14 | 15 | ############################################################################## |
15 | 16 | # Rich imports. |
|
26 | 27 | from textual.widgets import OptionList |
27 | 28 | from textual.widgets.option_list import Option |
28 | 29 | from textual.worker import get_current_worker |
29 | | -from typing_extensions import Final |
30 | 30 |
|
31 | 31 | ############################################################################## |
32 | 32 | # Local imports. |
@@ -348,9 +348,12 @@ def hide(self, path: Path) -> bool: |
348 | 348 | `True` if the path should be hidden, `False` if not. |
349 | 349 | """ |
350 | 350 | # If there's a custom filter in place, give that a go first... |
351 | | - if self.file_filter is not None and is_file(path): |
352 | | - if not self.file_filter(path): |
353 | | - return True |
| 351 | + if ( |
| 352 | + self.file_filter is not None |
| 353 | + and is_file(path) |
| 354 | + and not self.file_filter(path) |
| 355 | + ): |
| 356 | + return True |
354 | 357 | # Either there is no custom filter, or whatever we're looking at |
355 | 358 | # passed so far; not do final checks. |
356 | 359 | return self.is_hidden(path) and not self.show_hidden |
|
0 commit comments