diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-10-02 20:33:11 +0200 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-10-02 20:33:11 +0200 |
commit | 3c2999b2a73a72acbdba6012d8b6d8156f208fdb (patch) | |
tree | e83d1532f32ef84e133997823fb42d89c09b4f75 | |
parent | 90ece76465346ef87e2786b36891e2ad91c23f01 (diff) |
Prevent failure if dragon-drop isn't installed
-rw-r--r-- | src/event_exec.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/event_exec.rs b/src/event_exec.rs index e3d35a0..69525ca 100644 --- a/src/event_exec.rs +++ b/src/event_exec.rs @@ -511,8 +511,11 @@ impl EventAction { /// Executes a `dragon-drop` command on the selected file. /// It obviously requires the `dragon-drop` command to be installed. pub fn drag_n_drop(status: &mut Status) -> Result<()> { - let tab = status.selected_non_mut(); - let Some(file) = tab.selected() else { + if !is_program_in_path(DEFAULT_DRAGNDROP) { + write_log_line(format!("{DEFAULT_DRAGNDROP} must be installed.")); + return Ok(()); + } + let Some(file) = status.selected_non_mut().selected() else { return Ok(()); }; let path_str = file |