mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 21:05:00 +00:00
Allow more positions for not overwriting chunk
This commit is contained in:
parent
ac5bb4908e
commit
6ec79a1296
@ -127,12 +127,21 @@ 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 = if self.position == "left" {
|
||||||
0
|
0
|
||||||
|
} else if self.position == "off_left" {
|
||||||
|
0 - mat.hint.clone().unwrap().len()
|
||||||
|
} else if self.position == "off_right" {
|
||||||
|
text.len()
|
||||||
} else {
|
} else {
|
||||||
text.len() - mat.hint.clone().unwrap().len()
|
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());
|
||||||
|
|
||||||
|
let final_position = if (offset as i32 + extra_position as i32) < 0 {
|
||||||
|
0
|
||||||
|
} else {
|
||||||
|
offset + extra_position as u16
|
||||||
|
};
|
||||||
print!(
|
print!(
|
||||||
"{goto}{background}{foregroud}{text}{resetf}{resetb}",
|
"{goto}{background}{foregroud}{text}{resetf}{resetb}",
|
||||||
goto = cursor::Goto(offset + extra_position as u16 + 1, mat.y as u16 + 1),
|
goto = cursor::Goto(offset + extra_position as u16 + 1, mat.y as u16 + 1),
|
||||||
|
Loading…
Reference in New Issue
Block a user