mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-09 16:00:35 +00:00
Fix multi selection
This commit is contained in:
parent
ee850b2282
commit
9255c86797
23
src/view.rs
23
src/view.rs
@ -182,16 +182,6 @@ impl<'a> View<'a> {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Key::Insert => match self.matches.iter().enumerate().find(|&h| h.0 == self.skip) {
|
|
||||||
Some(hm) => {
|
|
||||||
chosen.push((hm.1.text.to_string(), false));
|
|
||||||
|
|
||||||
if !self.multi {
|
|
||||||
return CaptureEvent::Hint(chosen);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => panic!("Match not found?"),
|
|
||||||
},
|
|
||||||
Key::Up => {
|
Key::Up => {
|
||||||
self.prev();
|
self.prev();
|
||||||
}
|
}
|
||||||
@ -205,6 +195,19 @@ impl<'a> View<'a> {
|
|||||||
self.next();
|
self.next();
|
||||||
}
|
}
|
||||||
Key::Char(ch) => {
|
Key::Char(ch) => {
|
||||||
|
if ch == '\n' {
|
||||||
|
match self.matches.iter().enumerate().find(|&h| h.0 == self.skip) {
|
||||||
|
Some(hm) => {
|
||||||
|
chosen.push((hm.1.text.to_string(), false));
|
||||||
|
|
||||||
|
if !self.multi {
|
||||||
|
return CaptureEvent::Hint(chosen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => panic!("Match not found?"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ch == ' ' && self.multi {
|
if ch == ' ' && self.multi {
|
||||||
return CaptureEvent::Hint(chosen);
|
return CaptureEvent::Hint(chosen);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user