diff options
author | Denys Séguret <cano.petrole@gmail.com> | 2023-01-19 08:49:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 08:49:59 +0100 |
commit | e39742215b69d2cbc8398bdb9e9d430da1a49d48 (patch) | |
tree | 255206c8b435205e4c92ce8f5ca1a4de5e17a2b9 /src/app/app.rs | |
parent | 84e9b6bd7f0f3049982970e3eb7de3ca42e72996 (diff) |
Dir preview (#654)
- it's possible to call :open_preview when the selection is a directory
- when moving the selection in a browser view, the preview is updated accordingly even when it's a directory
Filtering, selections, scrolling, etc. are handled.
Like for other preview types, the Enter key does nothing (for now).
Diffstat (limited to 'src/app/app.rs')
-rw-r--r-- | src/app/app.rs | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/app/app.rs b/src/app/app.rs index 0ce2319..b75724f 100644 --- a/src/app/app.rs +++ b/src/app/app.rs @@ -524,7 +524,6 @@ impl App { app_state.root = path.to_path_buf(); } - if let Some(shared_root) = &mut self.shared_root { if let Ok(mut root) = shared_root.lock() { *root = app_state.root.clone(); @@ -542,7 +541,7 @@ impl App { if let Some(preview_idx) = preview_idx { if let Some(path) = self.state().selected_path() { let old_path = self.panels[preview_idx].state().selected_path(); - if (refresh || Some(path) != old_path) && path.is_file() { + if refresh || Some(path) != old_path { let path = path.to_path_buf(); self.panels[preview_idx].mut_state().set_selected_path(path, con); } @@ -626,17 +625,6 @@ impl App { self.update_preview(con, false); // the selection may have changed if let Some(error) = &error { self.mut_panel().set_error(error.to_string()); - //} else { - // // the refresh here removes the toggle status message. Not - // // sure there's a case it's useful - // let app_cmd_context = AppCmdContext { - // panel_skin: &skin.focused, - // preview_panel: self.preview_panel, - // stage_panel: self.stage_panel, - // screen: self.screen, - // con, - // }; - // self.mut_panel().refresh_input_status(app_state, &app_cmd_context); } self.display_panels(w, skin, app_state, con)?; if error.is_some() { |