mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 12:54:59 +00:00
Fix paste automatically
This commit is contained in:
parent
b1200599bf
commit
4f34101c23
10
src/main.rs
10
src/main.rs
@ -85,7 +85,9 @@ fn main() {
|
|||||||
let lines = output.split("\n").collect::<Vec<&str>>();
|
let lines = output.split("\n").collect::<Vec<&str>>();
|
||||||
|
|
||||||
let mut state = state::State::new(lines, alphabet);
|
let mut state = state::State::new(lines, alphabet);
|
||||||
|
let mut paste = false;
|
||||||
|
|
||||||
|
{
|
||||||
let mut rustbox = match RustBox::init(Default::default()) {
|
let mut rustbox = match RustBox::init(Default::default()) {
|
||||||
Result::Ok(v) => v,
|
Result::Ok(v) => v,
|
||||||
Result::Err(e) => panic!("{}", e),
|
Result::Err(e) => panic!("{}", e),
|
||||||
@ -176,8 +178,7 @@ fn main() {
|
|||||||
exec_command(format!("tmux set-buffer {}", mat.text));
|
exec_command(format!("tmux set-buffer {}", mat.text));
|
||||||
|
|
||||||
if key == key.to_uppercase() {
|
if key == key.to_uppercase() {
|
||||||
// FIXME
|
paste = true;
|
||||||
exec_command(format!("tmux paste-buffer"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -197,3 +198,8 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if paste {
|
||||||
|
exec_command(format!("tmux paste-buffer"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user