mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-09 16:00:35 +00:00
cleaning up with match per suggestion
This commit is contained in:
parent
f4696faf77
commit
0e04276056
13
src/view.rs
13
src/view.rs
@ -125,14 +125,11 @@ impl<'a> View<'a> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if let Some(ref hint) = mat.hint {
|
if let Some(ref hint) = mat.hint {
|
||||||
let extra_position = if self.position == "left" {
|
let extra_position = match self.position {
|
||||||
0
|
"right" => text.len() - mat.hint.clone().unwrap().len(),
|
||||||
} else if self.position == "off_left" {
|
"off_left" => 0 - mat.hint.clone().unwrap().len(),
|
||||||
0 - mat.hint.clone().unwrap().len()
|
"off_right" => text.len(),
|
||||||
} else if self.position == "off_right" {
|
_ => 0,
|
||||||
text.len()
|
|
||||||
} else {
|
|
||||||
text.len() - mat.hint.clone().unwrap().len()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let text = self.make_hint_text(hint.as_str());
|
let text = self.make_hint_text(hint.as_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user