Fix paste automatically

This commit is contained in:
Ferran Basora 2019-02-26 23:48:31 +00:00
parent b1200599bf
commit 4f34101c23

View File

@ -85,7 +85,9 @@ fn main() {
let lines = output.split("\n").collect::<Vec<&str>>();
let mut state = state::State::new(lines, alphabet);
let mut paste = false;
{
let mut rustbox = match RustBox::init(Default::default()) {
Result::Ok(v) => v,
Result::Err(e) => panic!("{}", e),
@ -176,8 +178,7 @@ fn main() {
exec_command(format!("tmux set-buffer {}", mat.text));
if key == key.to_uppercase() {
// FIXME
exec_command(format!("tmux paste-buffer"));
paste = true;
}
break;
@ -197,3 +198,8 @@ fn main() {
}
}
}
if paste {
exec_command(format!("tmux paste-buffer"));
}
}