Skip to content

Commit c784c9e

Browse files
author
Stephan Dilly
committed
safety first
1 parent 3ec47ce commit c784c9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/filetree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl DrawableComponent for FileTreeComponent {
253253
let select = self
254254
.tree
255255
.selection
256-
.map(|idx| idx - selection_offset)
256+
.map(|idx| idx.saturating_sub(selection_offset))
257257
.unwrap_or_default();
258258
let tree_height = r.height.saturating_sub(2) as usize;
259259

0 commit comments

Comments
 (0)