summaryrefslogtreecommitdiffstats
path: root/src/app/tab.rs
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2024-01-06 23:19:10 +0100
committerqkzk <qu3nt1n@gmail.com>2024-01-06 23:19:10 +0100
commit4c0ef7e24e3e493c4ea9001c490b56d8a11d3e3a (patch)
treec44eea4506dae916db36057c6be984d000da827f /src/app/tab.rs
parent45cd9e00d6b9710bb6c94708d34376e6d9a8d7a4 (diff)
display flagged: disable all cd since we can't see the directory
Diffstat (limited to 'src/app/tab.rs')
-rw-r--r--src/app/tab.rs4
1 files changed, 4 insertions, 0 deletions
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) => {