Fix run indicators jumping when buffer content changes. (#25507)

Co-authored-by: Anthony Eid <hello@anthonyeid.me>

Release Notes:

- Fix run indicators jumping when content changes

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
This commit is contained in:
Conrad Irwin 2025-02-24 15:57:54 -07:00 committed by GitHub
parent 63cfcc26fb
commit 7b277d2efd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 15 deletions

View file

@ -50,7 +50,7 @@ use language::{
use lsp::DiagnosticSeverity;
use multi_buffer::{
Anchor, ExcerptId, ExcerptInfo, ExpandExcerptDirection, MultiBufferPoint, MultiBufferRow,
RowInfo, ToOffset,
RowInfo,
};
use project::project_settings::{self, GitGutterSetting, ProjectSettings};
use settings::Settings;
@ -2062,21 +2062,22 @@ impl EditorElement {
None
};
let offset_range_start = snapshot
.display_point_to_anchor(DisplayPoint::new(range.start, 0), Bias::Left)
.to_offset(&snapshot.buffer_snapshot);
let offset_range_end = snapshot
.display_point_to_anchor(DisplayPoint::new(range.end, 0), Bias::Right)
.to_offset(&snapshot.buffer_snapshot);
let offset_range_start =
snapshot.display_point_to_point(DisplayPoint::new(range.start, 0), Bias::Left);
let offset_range_end =
snapshot.display_point_to_point(DisplayPoint::new(range.end, 0), Bias::Right);
editor
.tasks
.iter()
.filter_map(|(_, tasks)| {
if tasks.offset.0 < offset_range_start || tasks.offset.0 >= offset_range_end {
let multibuffer_point = tasks.offset.to_point(&snapshot.buffer_snapshot);
if multibuffer_point < offset_range_start
|| multibuffer_point > offset_range_end
{
return None;
}
let multibuffer_point = tasks.offset.0.to_point(&snapshot.buffer_snapshot);
let multibuffer_row = MultiBufferRow(multibuffer_point.row);
let buffer_folded = snapshot
.buffer_snapshot