mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-08 15:30:37 +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 {
|
||||
let extra_position = if self.position == "left" {
|
||||
0
|
||||
} else if self.position == "off_left" {
|
||||
0 - mat.hint.clone().unwrap().len()
|
||||
} else if self.position == "off_right" {
|
||||
text.len()
|
||||
} else {
|
||||
text.len() - mat.hint.clone().unwrap().len()
|
||||
let extra_position = match self.position {
|
||||
"right" => text.len() - mat.hint.clone().unwrap().len(),
|
||||
"off_left" => 0 - mat.hint.clone().unwrap().len(),
|
||||
"off_right" => text.len(),
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
let text = self.make_hint_text(hint.as_str());
|
||||
|
Loading…
Reference in New Issue
Block a user