From b53d1eef713d86fc59e63a4519bdcf8d9fa21f5d Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Tue, 28 Feb 2023 16:33:37 -0800 Subject: [PATCH] Added background styling of the ... --- crates/editor/src/editor.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 92338d7b3723cf58d82565fa0cabbade77ea6bf8..a366b7333f7f3b5a76ec606739a2d5d773c88aaa 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -5863,6 +5863,12 @@ impl Editor { } } }); + let click_ranges = self.clone_click_ranges::(); + self.highlight_background::( + click_ranges, + |theme| theme.editor.document_highlight_write_background, + cx, + ); cx.notify(); } @@ -5905,6 +5911,12 @@ impl Editor { } } }); + let click_ranges = self.clone_click_ranges::(); + self.highlight_background::( + click_ranges, + |theme| theme.editor.document_highlight_write_background, + cx, + ); cx.notify(); } @@ -6031,6 +6043,13 @@ impl Editor { } } + pub fn clone_click_ranges(&self) -> Vec> { + self.clickable_text + .get(&TypeId::of::()) + .map(|click_range| click_range.1.clone()) + .unwrap_or_default() + } + pub fn change_click_ranges( &mut self, cx: &mut ViewContext,