diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-03-11 15:22:17 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-03-11 15:22:17 -0400 |
commit | d9a4d91a6b00691d4b363edeb2623ccc8d1f1d55 (patch) | |
tree | 1cc764aa7afec97d1d7f4d983f075b0c2ebd95ac /src/commands | |
parent | c23a09814d861b0e7deee7d331fdb3c97deffb4b (diff) |
remove window module and fix unwrap none when opening file
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/open_file.rs | 7 |
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]; |