Fix incorrect highlighting when an empty range is highlighted via the DisplayMap

Co-Authored-By: Keith Simmons <keith@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-03-23 18:20:55 -07:00
parent 483a84a7f1
commit ff4bdb3114
4 changed files with 149 additions and 18 deletions

View file

@ -4,6 +4,8 @@ pub mod items;
pub mod movement;
mod multi_buffer;
pub mod repro;
#[cfg(test)]
mod test;
@ -4404,7 +4406,15 @@ impl Editor {
.into_iter()
.flat_map(|(_, ranges)| ranges),
)
.collect();
.collect::<Vec<_>>();
let snapshot = this.buffer.read(cx).snapshot(cx);
let point_ranges = ranges
.iter()
.map(|range| range.to_point(&snapshot))
.collect::<Vec<_>>();
dbg!(point_ranges);
this.highlight_text::<Rename>(
ranges,
HighlightStyle {