mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 02:37:21 +00:00
Do not render multiple hunks for the same line
This commit is contained in:
parent
8ced7ab00a
commit
492b849ea1
1 changed files with 6 additions and 0 deletions
|
@ -1057,6 +1057,7 @@ impl EditorElement {
|
|||
if layout.is_singleton && scrollbar_settings.selections {
|
||||
let start_anchor = Anchor::min();
|
||||
let end_anchor = Anchor::max();
|
||||
let mut last_rendered_row_range = (-1., -1.);
|
||||
for (row, _) in &editor.background_highlights_in_range(
|
||||
start_anchor..end_anchor,
|
||||
&layout.position_map.snapshot,
|
||||
|
@ -1069,6 +1070,11 @@ impl EditorElement {
|
|||
if end_y - start_y < 1. {
|
||||
end_y = start_y + 1.;
|
||||
}
|
||||
if (start_y, end_y) == last_rendered_row_range {
|
||||
skipped += 1;
|
||||
continue;
|
||||
}
|
||||
last_rendered_row_range = (start_y, end_y);
|
||||
let bounds = RectF::from_points(vec2f(left, start_y), vec2f(right, end_y));
|
||||
|
||||
let color = scrollbar_theme.selections;
|
||||
|
|
Loading…
Reference in a new issue