From bc579c0b93e00c1cf65d08e937b770e1c2c91acc Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 5 Feb 2025 19:26:19 +0800 Subject: [PATCH] table: Fix Table subtract with overflow error. (#602) ``` thread 'main' panicked at gpui-component-f2cfc37a601d48ab/dffb419/crates/ui/src/[table.rs:1562](http://table.rs:1562/):45: attempt to subtract with overflow stack backtrace: ``` --- crates/ui/src/table.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui/src/table.rs b/crates/ui/src/table.rs index 9d0f6031..a75ab4da 100644 --- a/crates/ui/src/table.rs +++ b/crates/ui/src/table.rs @@ -1559,7 +1559,7 @@ where } let mut items = Vec::with_capacity( - visible_range.end - visible_range.start, + visible_range.end.saturating_sub(visible_range.start), ); // Render fake rows to fill the table