feat: Toggle showing hidden items

`ctrl` + `h` toggles the visibility of hidden files and folders per tab.
The per tab option overrides the global option. So, a user may set
hidden items to be visible by default (global option) but override it
per tab with `ctrl` + `h`.

Currently, per tab options aren't presented anywhere in the UI such as a
menu, so the hotkey is the only way to use this feature for now.
This commit is contained in:
Josh Megnauth 2024-02-11 00:24:35 -05:00 committed by Jeremy Soller
parent 073a9a95ab
commit bc5b46d552
4 changed files with 15 additions and 8 deletions

View file

@ -349,8 +349,7 @@ impl Application for App {
if let Some(tab) = self.tab_model.data_mut::<Tab>(entity) {
if let Some(ref mut items) = tab.items_opt {
for item in items.iter_mut() {
if item.hidden {
//TODO: option to show hidden files
if !tab.config.show_hidden && item.hidden {
continue;
}
item.selected = true;