Skip to content

Commit cb1e0e0

Browse files
committed
fix: visual mode select indicator missing on tall displays
1 parent 8026e52 commit cb1e0e0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/widget/results.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,9 @@ impl super::Widget for ResultsWidget {
200200

201201
if area.height >= 3 {
202202
let offset = self.table.state.offset();
203-
if let Some(visible_items) = ctx
204-
.results
205-
.response
206-
.items
207-
.get(offset..(offset + visible_height))
208-
{
203+
let start = offset.min(ctx.results.response.items.len());
204+
let end = (offset + visible_height).min(ctx.results.response.items.len());
205+
if let Some(visible_items) = ctx.results.response.items.get(start..end) {
209206
let selected_ids: Vec<String> =
210207
ctx.batch.clone().into_iter().map(|i| i.id).collect();
211208
let vert_left = ctx.theme.border.to_border_set().vertical_left;

0 commit comments

Comments
 (0)