diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2024-02-28 16:21:58 -0500 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2024-02-28 16:21:58 -0500 |
commit | dfbf093611d77e5d95c34f11a496f7f2001273ab (patch) | |
tree | a89d22b24d752a01c7f245a5654030777a00b84b /src/commands/sort.rs | |
parent | 83bde18aca7078b846f2fc6bbe0f718c4e8c9aec (diff) | |
parent | 0796039c8a135951e1bff3654cd7a2dc8039c0fe (diff) |
Merge branch 'main' of github.com:kamiyaa/joshuto
Diffstat (limited to 'src/commands/sort.rs')
-rw-r--r-- | src/commands/sort.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/commands/sort.rs b/src/commands/sort.rs index f78fd0a..7bea48f 100644 --- a/src/commands/sort.rs +++ b/src/commands/sort.rs @@ -25,5 +25,22 @@ pub fn toggle_reverse(context: &mut AppContext) -> AppResult { fn refresh(context: &mut AppContext) -> AppResult { reload::soft_reload_curr_tab(context)?; + + let ui_context = context.ui_context_ref().clone(); + let display_options = context.config_ref().display_options_ref().clone(); + let curr_tab = context.tab_context_mut().curr_tab_mut(); + + macro_rules! update_viewport { + ($x_list_mut: ident) => { + if let Some(list) = curr_tab.$x_list_mut() { + list.update_viewport(&ui_context, &display_options); + } + }; + } + + update_viewport!(curr_list_mut); + update_viewport!(parent_list_mut); + update_viewport!(child_list_mut); + Ok(()) } |