mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-09 16:00:35 +00:00
Fix issue with reverse and long hint
This commit is contained in:
parent
0174027031
commit
6a43364f1c
@ -62,7 +62,7 @@ impl<'a> View<'a> {
|
|||||||
|
|
||||||
let mut typed_hint: String = "".to_owned();
|
let mut typed_hint: String = "".to_owned();
|
||||||
let matches = self.state.matches(self.reverse, self.unique);
|
let matches = self.state.matches(self.reverse, self.unique);
|
||||||
let longest_hint = matches.iter().filter(|&m| m.hint.clone().is_some()).last().unwrap().hint.clone().expect("Unknown hint").len();
|
let longest_hint = matches.iter().filter_map(|m| m.hint.clone()).max_by(|x, y| x.len().cmp(&y.len())).unwrap().clone();
|
||||||
let mut selected;
|
let mut selected;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
@ -126,7 +126,7 @@ impl<'a> View<'a> {
|
|||||||
return Some((mat.text.to_string(), key != lower_key))
|
return Some((mat.text.to_string(), key != lower_key))
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
if typed_hint.len() >= longest_hint {
|
if typed_hint.len() >= longest_hint.len() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user