diff options
author | Canop <cano.petrole@gmail.com> | 2022-10-01 19:53:46 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-10-01 19:53:46 +0200 |
commit | c372aef844ae59e5cb65f0815c2868f19d58aa64 (patch) | |
tree | 29e01cbe1530bf73684899a1b2c200c85dedb430 /src/stage | |
parent | 79ed47d94cc011b2bc3dc597226768c4aed0f0c7 (diff) |
Status message on toggling tree options
Diffstat (limited to 'src/stage')
-rw-r--r-- | src/stage/stage_state.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/stage/stage_state.rs b/src/stage/stage_state.rs index 997e544..229413c 100644 --- a/src/stage/stage_state.rs +++ b/src/stage/stage_state.rs @@ -240,7 +240,7 @@ impl PanelState for StageState { fn with_new_options( &mut self, _screen: Screen, - change_options: &dyn Fn(&mut TreeOptions), + change_options: &dyn Fn(&mut TreeOptions) -> &'static str, in_new_panel: bool, con: &AppContext, ) -> CmdResult { @@ -248,15 +248,16 @@ impl PanelState for StageState { CmdResult::error("stage can't be displayed in two panels") } else { let mut new_options= self.tree_options(); - change_options(&mut new_options); - CmdResult::NewState(Box::new(StageState { + let message = change_options(&mut new_options); + let state = Box::new(StageState { filtered_stage: self.filtered_stage.clone(), scroll: self.scroll, mode: initial_mode(con), tree_options: new_options, page_height: self.page_height, stage_sum: self.stage_sum, - })) + }); + CmdResult::NewState { state, message: Some(message) } } } |