Prevent negative index for bottom in empty dir (#1986)

This commit is contained in:
Joe Lim authored and GitHub committed 2025-05-12 14:43:39 +10:00
1 parent e7ea6c6d0d
commit 7158e09033
1 file changed
+1 -1
+1 -1
View File
@@ -1066,7 +1066,7 @@ func (nav *nav) bottom() bool {
old := dir.ind old := dir.ind
dir.ind = len(dir.files) - 1 dir.ind = max(len(dir.files)-1, 0)
dir.pos = min(dir.ind, nav.height-1) dir.pos = min(dir.ind, nav.height-1)
return old != dir.ind return old != dir.ind