Skip to content

Commit 6890784

Browse files
committed
chore: skip the selection indicator for wrapped lines
1 parent ee07e89 commit 6890784

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/screen/mod.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,9 @@ impl Widget for &Screen {
354354
if self.line_index[self.cursor] == line.item_index {
355355
buf.set_style(indented_line_area, &style.selection_line);
356356
} else {
357-
for i in 0..height {
358-
buf[(SCREEN_GUTTER_COLUMN_CURSOR, line_index + i)]
359-
.set_char(style.selection_bar.symbol)
360-
.set_style(&style.selection_bar);
361-
}
357+
buf[(SCREEN_GUTTER_COLUMN_CURSOR, line_index)]
358+
.set_char(style.selection_bar.symbol)
359+
.set_style(&style.selection_bar);
362360
}
363361
}
364362

@@ -380,11 +378,9 @@ impl Widget for &Screen {
380378
}
381379

382380
if self.line_index[self.cursor] == line.item_index {
383-
for i in 0..height {
384-
buf[(SCREEN_GUTTER_COLUMN_CURSOR, line_index + i as u16)]
385-
.set_char(style.cursor.symbol)
386-
.set_style(&style.cursor);
387-
}
381+
buf[(SCREEN_GUTTER_COLUMN_CURSOR, line_index)]
382+
.set_char(style.cursor.symbol)
383+
.set_style(&style.cursor);
388384
}
389385

390386
line_index += height;

0 commit comments

Comments
 (0)