Fixed an accidental overflow bug when determining when to scroll text horizontally or not
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "managarr"
|
name = "managarr"
|
||||||
version = "0.1.9"
|
version = "0.1.10"
|
||||||
authors = ["Alex Clarke <alex.j.tusa@gmail.com>"]
|
authors = ["Alex Clarke <alex.j.tusa@gmail.com>"]
|
||||||
description = "A TUI for managing *arr servers"
|
description = "A TUI for managing *arr servers"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
+1
-1
@@ -208,7 +208,7 @@ impl HorizontallyScrollableText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn scroll_or_reset(&self, width: usize, is_current_selection: bool) {
|
pub fn scroll_or_reset(&self, width: usize, is_current_selection: bool) {
|
||||||
if is_current_selection && self.text.len() - 8 > width {
|
if is_current_selection && self.text.len().saturating_sub(4) > width {
|
||||||
self.scroll_text();
|
self.scroll_text();
|
||||||
} else {
|
} else {
|
||||||
self.reset_offset();
|
self.reset_offset();
|
||||||
|
|||||||
Reference in New Issue
Block a user