diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index e5b60496456358..38e4b23801d89f 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -4782,6 +4782,15 @@ impl Editor { self.clear_background_highlights::(cx); return; } + if self.selections.count() != 1 || self.selections.line_mode { + self.clear_background_highlights::(cx); + return; + } + let selection = self.selections.newest::(cx); + if selection.is_empty() || selection.start.row != selection.end.row { + self.clear_background_highlights::(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()