summaryrefslogtreecommitdiffstats
path: root/src/commands/open_file.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/open_file.rs')
-rw-r--r--src/commands/open_file.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/commands/open_file.rs b/src/commands/open_file.rs
index 39524e7..c871c29 100644
--- a/src/commands/open_file.rs
+++ b/src/commands/open_file.rs
@@ -55,8 +55,9 @@ impl OpenFile {
let options = Self::get_options(paths[0]);
if options.len() > 0 {
backend.terminal_drop();
- options[0].execute_with(&paths)?;
- backend.terminal_restore();
+ let res = options[0].execute_with(&paths);
+ backend.terminal_restore()?;
+ return res;
} else {
OpenFileWith::open_with(context, backend, &paths)?;
}
@@ -123,7 +124,7 @@ impl OpenFileWith {
match user_input.parse::<usize>() {
Ok(n) if n >= mimetype_options.len() => Err(std::io::Error::new(
std::io::ErrorKind::InvalidData,
- "option does not exist".to_owned(),
+ "option does not exist".to_string(),
)),
Ok(n) => {
let mimetype_entry = &mimetype_options[n];