editor: Disable selection highlights for single line editor (#26805)

Smit Barmase created

Fixes the selection highlight appearing in single-line editors like the
file picker, command palette, etc.

Release Notes:

- Fixed selection highlight appearing in input fields like the file
picker, command palette, etc.

Change summary

crates/editor/src/editor.rs | 3 +++
1 file changed, 3 insertions(+)

Detailed changes

crates/editor/src/editor.rs 🔗

@@ -4949,6 +4949,9 @@ impl Editor {
         window: &mut Window,
         cx: &mut Context<Editor>,
     ) {
+        if matches!(self.mode, EditorMode::SingleLine { .. }) {
+            return;
+        }
         self.selection_highlight_task.take();
         if !EditorSettings::get_global(cx).selection_highlight {
             self.clear_background_highlights::<SelectedTextHighlight>(cx);