Properly calculate expanded git diff hunk highlight ranges (#11632)
Closes https://github.com/zed-industries/zed/issues/11576 Release Notes: - Fixed expanded diff hunks highlighting an extra row as added ([11576](https://github.com/zed-industries/zed/issues/11576))
This commit is contained in:
parent
50c45c7897
commit
4762e52d31
7 changed files with 161 additions and 121 deletions
|
@ -142,7 +142,7 @@ impl OutlineViewDelegate {
|
|||
self.active_editor.update(cx, |active_editor, cx| {
|
||||
active_editor.clear_row_highlights::<OutlineRowHighlights>();
|
||||
active_editor.highlight_rows::<OutlineRowHighlights>(
|
||||
outline_item.range.clone(),
|
||||
outline_item.range.start..=outline_item.range.end,
|
||||
Some(cx.theme().colors().editor_highlighted_line_background),
|
||||
cx,
|
||||
);
|
||||
|
@ -243,7 +243,7 @@ impl PickerDelegate for OutlineViewDelegate {
|
|||
.and_then(|highlights| highlights.into_iter().next().map(|(rows, _)| rows.clone()))
|
||||
{
|
||||
active_editor.change_selections(Some(Autoscroll::center()), cx, |s| {
|
||||
s.select_ranges([rows.start..rows.start])
|
||||
s.select_ranges([*rows.start()..*rows.start()])
|
||||
});
|
||||
active_editor.clear_row_highlights::<OutlineRowHighlights>();
|
||||
active_editor.focus(cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue