aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authornuid322023-03-05 11:43:24 +0000
committerGitHub2023-03-05 11:43:24 +0000
commitdef26966d22dfc4b9a74e51542db246ba52f3dc9 (patch)
tree9d584a465bb2d87d883889d6d3a976b6c428cc08 /helix-view/src
parentccdb1446652662e2577fb7405fee9ccd49c56180 (diff)
Fix lacking space panic (#6109)
* Fix lack of space for popup crash * Fix saturating -> wrapping * Fix wrapping -> saturating (I am an idiot) * Remove useless "mut" in helix-tui/src/buffer.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * Remove redundant bound-check * Return bound-check back * Add bound-check for set_style * Remove set_style bound-check * Revert bound-check --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/graphics.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-view/src/graphics.rs b/helix-view/src/graphics.rs
index a0b645fa..e813fb56 100644
--- a/helix-view/src/graphics.rs
+++ b/helix-view/src/graphics.rs
@@ -237,8 +237,8 @@ impl Rect {
Rect {
x: x1,
y: y1,
- width: x2 - x1,
- height: y2 - y1,
+ width: x2.saturating_sub(x1),
+ height: y2.saturating_sub(y1),
}
}