Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

editor: Remove duplicate method (#49592)

Marco Mihai Condrache9d779879f284
diff --git a/crates/debugger_ui/src/session/running/console.rs b/crates/debugger_ui/src/session/running/console.rs
index de9d448bf56..147dd9baf40 100644
--- a/crates/debugger_ui/src/session/running/console.rs
+++ b/crates/debugger_ui/src/session/running/console.rs
@@ -251,7 +251,7 @@ impl Console {
let range = buffer.anchor_after(MultiBufferOffset(range.start))
..buffer.anchor_before(MultiBufferOffset(range.end));
let color_fn = color_fetcher(color);
- console.highlight_background_key(
+ console.highlight_background(
HighlightKey::ConsoleAnsiHighlight(start_offset),
&[range],
move |_, theme| color_fn(theme),
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index f92b1023691..36647fca631 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -23483,19 +23483,6 @@ impl Editor {
cx.notify();
}
- pub fn highlight_background_key(
- &mut self,
- key: HighlightKey,
- ranges: &[Range<Anchor>],
- color_fetcher: impl Fn(&usize, &Theme) -> Hsla + Send + Sync + 'static,
- cx: &mut Context<Self>,
- ) {
- self.background_highlights
- .insert(key, (Arc::new(color_fetcher), Arc::from(ranges)));
- self.scrollbar_marker_state.dirty = true;
- cx.notify();
- }
-
pub fn clear_background_highlights(
&mut self,
key: HighlightKey,
diff --git a/crates/language_tools/src/highlights_tree_view.rs b/crates/language_tools/src/highlights_tree_view.rs
index 5fb0ddf8973..fe09a3f3849 100644
--- a/crates/language_tools/src/highlights_tree_view.rs
+++ b/crates/language_tools/src/highlights_tree_view.rs
@@ -556,7 +556,7 @@ impl HighlightsTreeView {
ranges: &[Range<Anchor>],
cx: &mut Context<Editor>,
) {
- editor.highlight_background_key(
+ editor.highlight_background(
HighlightKey::HighlightsTreeView(key),
ranges,
|_, theme| theme.colors().editor_document_highlight_write_background,
diff --git a/crates/language_tools/src/syntax_tree_view.rs b/crates/language_tools/src/syntax_tree_view.rs
index 161a2e86499..b44d2e05d90 100644
--- a/crates/language_tools/src/syntax_tree_view.rs
+++ b/crates/language_tools/src/syntax_tree_view.rs
@@ -484,7 +484,7 @@ impl SyntaxTreeView {
ranges: &[Range<Anchor>],
cx: &mut Context<Editor>,
) {
- editor.highlight_background_key(
+ editor.highlight_background(
HighlightKey::SyntaxTreeView(key),
ranges,
|_, theme| theme.colors().editor_document_highlight_write_background,