Skip to content

Commit

Permalink
should remove highlights if selection change is detected before debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtimsb committed Feb 19, 2025
1 parent c2c48d9 commit a38002d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4782,6 +4782,15 @@ impl Editor {
self.clear_background_highlights::<SelectedTextHighlight>(cx);
return;
}
if self.selections.count() != 1 || self.selections.line_mode {
self.clear_background_highlights::<SelectedTextHighlight>(cx);
return;
}
let selection = self.selections.newest::<Point>(cx);
if selection.is_empty() || selection.start.row != selection.end.row {
self.clear_background_highlights::<SelectedTextHighlight>(cx);
return;
}
let debounce = EditorSettings::get_global(cx).selection_highlight_debounce;
self.selection_highlight_task = Some(cx.spawn_in(window, |editor, mut cx| async move {
cx.background_executor()
Expand Down

0 comments on commit a38002d

Please sign in to comment.