editor: Fix selection and bracket pair highlight not appearing on collab updates (#29558)
This PR fixes bug where selection and bracket pair highlights would not update when new text was added via collab. Release Notes: - Fixed an issue where selection and bracket pair highlights would not update when new text was added via collab. --------- Co-authored-by: Ben Kunkle <ben@zed.dev>
This commit is contained in:
parent
9abeedf0c6
commit
2139219832
1 changed files with 23 additions and 14 deletions
|
@ -2623,7 +2623,7 @@ impl Editor {
|
|||
}
|
||||
self.refresh_code_actions(window, cx);
|
||||
self.refresh_document_highlights(cx);
|
||||
self.refresh_selected_text_highlights(window, cx);
|
||||
self.refresh_selected_text_highlights(false, window, cx);
|
||||
refresh_matching_bracket_highlights(self, window, cx);
|
||||
self.update_visible_inline_completion(window, cx);
|
||||
self.edit_prediction_requires_modifier_in_indent_conflict = true;
|
||||
|
@ -5817,7 +5817,12 @@ impl Editor {
|
|||
})
|
||||
}
|
||||
|
||||
fn refresh_selected_text_highlights(&mut self, window: &mut Window, cx: &mut Context<Editor>) {
|
||||
fn refresh_selected_text_highlights(
|
||||
&mut self,
|
||||
on_buffer_edit: bool,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Editor>,
|
||||
) {
|
||||
let Some((query_text, query_range)) = self.prepare_highlight_query_from_selection(cx)
|
||||
else {
|
||||
self.clear_background_highlights::<SelectedTextHighlight>(cx);
|
||||
|
@ -5826,7 +5831,8 @@ impl Editor {
|
|||
return;
|
||||
};
|
||||
let multi_buffer_snapshot = self.buffer().read(cx).snapshot(cx);
|
||||
if self
|
||||
if on_buffer_edit
|
||||
|| self
|
||||
.quick_selection_highlight_task
|
||||
.as_ref()
|
||||
.map_or(true, |(prev_anchor_range, _)| {
|
||||
|
@ -5856,7 +5862,8 @@ impl Editor {
|
|||
),
|
||||
));
|
||||
}
|
||||
if self
|
||||
if on_buffer_edit
|
||||
|| self
|
||||
.debounced_selection_highlight_task
|
||||
.as_ref()
|
||||
.map_or(true, |(prev_anchor_range, _)| {
|
||||
|
@ -17749,6 +17756,8 @@ impl Editor {
|
|||
self.active_indent_guides_state.dirty = true;
|
||||
self.refresh_active_diagnostics(cx);
|
||||
self.refresh_code_actions(window, cx);
|
||||
self.refresh_selected_text_highlights(true, window, cx);
|
||||
refresh_matching_bracket_highlights(self, window, cx);
|
||||
if self.has_active_inline_completion() {
|
||||
self.update_visible_inline_completion(window, cx);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue