diff options
Diffstat (limited to 'src/browser/browser_state.rs')
-rw-r--r-- | src/browser/browser_state.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index 70d8eec..a136514 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -205,8 +205,14 @@ impl PanelState for BrowserState { let tree = self.displayed_tree(); let mut options = tree.options.clone(); change_options(&mut options); + let mut new_state = BrowserState::new(tree.root().clone(), options, screen, con, &Dam::unlimited()); + if let Ok(Some(bs)) = &mut new_state { + if tree.selection != 0 { + bs.displayed_tree_mut().try_select_path(&tree.selected_line().path); + } + } CmdResult::from_optional_state( - BrowserState::new(tree.root().clone(), options, screen, con, &Dam::unlimited()), + new_state, in_new_panel, ) } |