mirror of https://github.com/bobwen-dev/hunter
change opener to rifle
This commit is contained in:
parent
528f725145
commit
e07f9af433
|
@ -72,17 +72,17 @@ impl FileBrowser {
|
|||
Err(ref err) if err.description() == "placeholder".to_string() =>
|
||||
self.show_status("No! Can't open this!"),
|
||||
_ => {
|
||||
let status = std::process::Command::new("xdg-open")
|
||||
.args(dbg!(file.path.file_name()))
|
||||
let status = std::process::Command::new("rifle")
|
||||
.args(file.path.file_name())
|
||||
.status();
|
||||
|
||||
match status {
|
||||
Ok(status) =>
|
||||
self.show_status(&format!("\"{}\" exited with {}",
|
||||
"xdg-open", status)),
|
||||
"rifle", status)),
|
||||
Err(err) =>
|
||||
self.show_status(&format!("Can't run this \"{}\": {}",
|
||||
"xdg-open", err))
|
||||
"rifle", err))
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ use termion::event::{Event, Key};
|
|||
use unicode_width::UnicodeWidthStr;
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::io::Write;
|
||||
|
||||
use crate::coordinates::{Coordinates, Position, Size};
|
||||
use crate::files::{File, Files};
|
||||
|
@ -320,6 +321,11 @@ where
|
|||
.arg("-c")
|
||||
.arg(&cmd)
|
||||
.status();
|
||||
|
||||
write!(std::io::stdout(), "{}{}",
|
||||
termion::style::Reset,
|
||||
termion::clear::All).unwrap();
|
||||
|
||||
match status {
|
||||
Ok(status) => self.show_status(&format!("\"{}\" exited with {}",
|
||||
cmd, status)),
|
||||
|
|
|
@ -74,6 +74,7 @@ where
|
|||
//Self::clear_status();
|
||||
let event = event.unwrap();
|
||||
self.widget.on_event(event);
|
||||
self.screen.cursor_hide();
|
||||
self.draw();
|
||||
}
|
||||
}
|
||||
|
@ -150,8 +151,12 @@ pub fn minibuffer(query: &str) -> Option<String> {
|
|||
Key::Esc | Key::Ctrl('c') => break,
|
||||
Key::Char('\n') => {
|
||||
if buffer == "" {
|
||||
write!(stdout(), "{}", termion::cursor::Hide).unwrap();
|
||||
stdout().flush().unwrap();
|
||||
return None;
|
||||
} else {
|
||||
write!(stdout(), "{}", termion::cursor::Hide).unwrap();
|
||||
stdout().flush().unwrap();
|
||||
return Some(buffer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue