summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--development.md1
-rw-r--r--src/app/tab.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/development.md b/development.md
index d6a7dc5..a019552 100644
--- a/development.md
+++ b/development.md
@@ -810,6 +810,7 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally.
- [x] disable regex match in flagged. Should it only keep the flagged files ? Would require to save the files before entering...
- [x] chmod
- [x] disable new nodes (file, dir)
+ - [x] disable all cd since we can't see the directory
- [x] trashmode should display which shortcut erase all trash.
- [x] add left tab current dir to right shortcut and vice versa
diff --git a/src/app/tab.rs b/src/app/tab.rs
index c6fe8af..87bd112 100644
--- a/src/app/tab.rs
+++ b/src/app/tab.rs
@@ -440,7 +440,11 @@ impl Tab {
/// Set the pathcontent to a new path.
/// Reset the window.
/// Add the last path to the history of visited paths.
+ /// Does nothing in preview or flagged display mode.
pub fn cd(&mut self, path: &path::Path) -> Result<()> {
+ if matches!(self.display_mode, Display::Preview | Display::Flagged) {
+ return Ok(());
+ }
match std::env::set_current_dir(path) {
Ok(()) => (),
Err(error) => {