From 37fa8efbd8691d89fcd22727e3720621fff3680c Mon Sep 17 00:00:00 2001 From: Jiayi Zhao Date: Tue, 2 Apr 2019 21:12:22 -0400 Subject: refactor sorting structs - filtering hidden files is de-coupled from creating direntries --- src/commands/show_hidden.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/commands/show_hidden.rs') diff --git a/src/commands/show_hidden.rs b/src/commands/show_hidden.rs index 12f08c5..be41264 100644 --- a/src/commands/show_hidden.rs +++ b/src/commands/show_hidden.rs @@ -14,12 +14,12 @@ impl ToggleHiddenFiles { "toggle_hidden" } pub fn toggle_hidden(context: &mut JoshutoContext) { - let opposite = !context.config_t.sort_type.show_hidden(); - context.config_t.sort_type.set_show_hidden(opposite); + let opposite = !context.config_t.sort_option.show_hidden; + context.config_t.sort_option.show_hidden = opposite; for tab in &mut context.tabs { tab.history.depecrate_all_entries(); - tab.reload_contents(&context.config_t.sort_type); + tab.reload_contents(&context.config_t.sort_option); } } } @@ -36,7 +36,7 @@ impl JoshutoRunnable for ToggleHiddenFiles { fn execute(&self, context: &mut JoshutoContext, view: &JoshutoView) { Self::toggle_hidden(context); let curr_tab = &mut context.tabs[context.curr_tab_index]; - curr_tab.reload_contents(&context.config_t.sort_type); + curr_tab.reload_contents(&context.config_t.sort_option); curr_tab.refresh( view, &context.config_t, -- cgit v1.2.3