summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--development.md2
-rw-r--r--src/event/event_exec.rs18
-rw-r--r--src/modes/edit/permissions.rs1
3 files changed, 18 insertions, 3 deletions
diff --git a/development.md b/development.md
index 8d7e760..d6a7dc5 100644
--- a/development.md
+++ b/development.md
@@ -808,6 +808,8 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally.
- [x] bulk update flagged with new names
- [x] custom search with completion
- [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] trashmode should display which shortcut erase all trash.
- [x] add left tab current dir to right shortcut and vice versa
diff --git a/src/event/event_exec.rs b/src/event/event_exec.rs
index 72814c0..c8974ac 100644
--- a/src/event/event_exec.rs
+++ b/src/event/event_exec.rs
@@ -273,12 +273,26 @@ impl EventAction {
/// Enter the new dir mode.
pub fn new_dir(status: &mut Status) -> Result<()> {
- status.set_edit_mode(status.index, Edit::InputSimple(InputSimple::Newdir))
+ if matches!(
+ status.current_tab().display_mode,
+ Display::Directory | Display::Tree
+ ) {
+ status.set_edit_mode(status.index, Edit::InputSimple(InputSimple::Newdir))
+ } else {
+ Ok(())
+ }
}
/// Enter the new file mode.
pub fn new_file(status: &mut Status) -> Result<()> {
- status.set_edit_mode(status.index, Edit::InputSimple(InputSimple::Newfile))
+ if matches!(
+ status.current_tab().display_mode,
+ Display::Directory | Display::Tree
+ ) {
+ status.set_edit_mode(status.index, Edit::InputSimple(InputSimple::Newfile))
+ } else {
+ Ok(())
+ }
}
fn enter_file(status: &mut Status) -> Result<()> {
diff --git a/src/modes/edit/permissions.rs b/src/modes/edit/permissions.rs
index d31d5fe..ae7aee8 100644
--- a/src/modes/edit/permissions.rs
+++ b/src/modes/edit/permissions.rs
@@ -41,7 +41,6 @@ impl Permissions {
for path in &flagged.content {
Self::set_permissions(path, mode.octal())?;
}
- flagged.clear();
log_line!("Changed permissions to {mode_str}");
Ok(())
}