summaryrefslogtreecommitdiffstats
path: root/src/event_exec.rs
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2023-09-19 21:10:14 +0200
committerqkzk <qu3nt1n@gmail.com>2023-09-19 21:10:14 +0200
commit4ea12514b7e9b016e249ebdaa9bda2e6a040f1b1 (patch)
tree30ca0b68c9f0bcb61f244f306e628865eeb586d4 /src/event_exec.rs
parentd251d282a363affc7c85fb55a655daf1dda92724 (diff)
log more messages to target special. Display last action in last line
Diffstat (limited to 'src/event_exec.rs')
-rw-r--r--src/event_exec.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/event_exec.rs b/src/event_exec.rs
index 86ddd6f..0950534 100644
--- a/src/event_exec.rs
+++ b/src/event_exec.rs
@@ -1066,7 +1066,9 @@ impl LeaveMode {
let len = status.selected_non_mut().path_content.content.len();
if let Some((ch, _)) = marks.selected() {
if let Some(path_str) = status.selected_non_mut().path_content_str() {
- status.marks.new_mark(*ch, path::PathBuf::from(path_str))?;
+ let p = path::PathBuf::from(path_str);
+ status.marks.new_mark(*ch, &p)?;
+ log::info!(target : "special", "Saved mark {ch} -> {p}", p=p.display());
}
status.selected().window.reset(len);
status.selected().input.reset();
@@ -1097,16 +1099,17 @@ impl LeaveMode {
/// Nothing is done if the user typed nothing or an invalid permission like
/// 955.
pub fn chmod(status: &mut Status) -> Result<()> {
- if status.selected().input.is_empty() {
+ if status.selected().input.is_empty() || status.flagged.is_empty() {
return Ok(());
}
- let permissions: u32 =
- u32::from_str_radix(&status.selected().input.string(), 8).unwrap_or(0_u32);
+ let input_permission = &status.selected().input.string();
+ let permissions: u32 = u32::from_str_radix(input_permission, 8).unwrap_or(0_u32);
if permissions <= Status::MAX_PERMISSIONS {
for path in status.flagged.content.iter() {
Status::set_permissions(path, permissions)?
}
- status.flagged.clear()
+ status.flagged.clear();
+ log::info!(target:"special", "Changed permissions to {input_permission}")
}
status.selected().refresh_view()?;
status.reset_tabs_view()
@@ -1145,8 +1148,8 @@ impl LeaveMode {
}
/// Execute a shell command typed by the user.
- /// pipes and redirections aren't NotSupported
- /// expansions are supported
+ /// pipes and redirections aren't supported
+ /// but expansions are supported
pub fn shell(status: &mut Status) -> Result<bool> {
let shell_command = status.selected_non_mut().input.string();
let mut args = ShellCommandParser::new(&shell_command).compute(status)?;