diff options
author | rabite <rabite@posteo.de> | 2019-02-09 19:34:21 +0100 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2019-02-09 19:34:21 +0100 |
commit | e07f9af433da7b72d74ccfdd29ec7e5f6ec301c5 (patch) | |
tree | abe051acbf777a985dd1fb9a5e3b4760b71dd87f /src | |
parent | 528f7251452782b4b2bc24fedfd3f34e80575283 (diff) |
change opener to rifle
Diffstat (limited to 'src')
-rw-r--r-- | src/file_browser.rs | 8 | ||||
-rw-r--r-- | src/listview.rs | 6 | ||||
-rw-r--r-- | src/window.rs | 9 |
3 files changed, 17 insertions, 6 deletions
diff --git a/src/file_browser.rs b/src/file_browser.rs index f152d25..97bb24f 100644 --- a/src/file_browser.rs +++ b/src/file_browser.rs @@ -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)) } } diff --git a/src/listview.rs b/src/listview.rs index a466e3a..990e337 100644 --- a/src/listview.rs +++ b/src/listview.rs @@ -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)), diff --git a/src/window.rs b/src/window.rs index 49a401f..1642425 100644 --- a/src/window.rs +++ b/src/window.rs @@ -74,6 +74,7 @@ where //Self::clear_status(); let event = event.unwrap(); self.widget.on_event(event); + self.screen.cursor_hide(); self.draw(); } } @@ -136,8 +137,8 @@ pub fn show_status(status: &str) { pub fn minibuffer(query: &str) -> Option<String> { show_status(&(query.to_string() + ": ")); write!(stdout(), "{}{}", - termion::cursor::Show, - termion::cursor::Save).unwrap(); + termion::cursor::Show, + termion::cursor::Save).unwrap(); stdout().flush().unwrap(); let mut buffer = "".to_string(); @@ -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); } } |