Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
git: Disable some more expensive things for the split diff's left-hand side (#48953)
Cole Millerb53ff3b89347
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex b42227add56..6b2cd48aa60 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -1181,6 +1181,8 @@ pub struct Editor {delegate_expand_excerpts: bool,delegate_stage_and_restore: bool,delegate_open_excerpts: bool,+ enable_lsp_data: bool,+ enable_runnables: bool,show_line_numbers: Option<bool>,use_relative_line_numbers: Option<bool>,show_git_diff_gutter: Option<bool>,@@ -2414,6 +2416,8 @@ impl Editor {delegate_expand_excerpts: false,delegate_stage_and_restore: false,delegate_open_excerpts: false,+ enable_lsp_data: true,+ enable_runnables: true,show_git_diff_gutter: None,show_code_actions: None,show_runnables: None,@@ -16927,7 +16931,7 @@ impl Editor {}fn refresh_runnables(&mut self, window: &mut Window, cx: &mut Context<Self>) -> Task<()> {- if !EditorSettings::get_global(cx).gutter.runnables {+ if !EditorSettings::get_global(cx).gutter.runnables || !self.enable_runnables {self.clear_tasks();return Task::ready(());}@@ -25243,6 +25247,10 @@ impl Editor {window: &mut Window,cx: &mut Context<'_, Self>,) {+ if !self.enable_lsp_data {+ return;+ }+if let Some(buffer_id) = for_buffer {self.pull_diagnostics(buffer_id, window, cx);}@@ -25377,6 +25385,14 @@ impl Editor {}));Some(breadcrumbs)}++ fn disable_lsp_data(&mut self) {+ self.enable_lsp_data = false;+ }++ fn disable_runnables(&mut self) {+ self.enable_runnables = false;+ }}fn edit_for_markdown_paste<'a>(diff --git a/crates/editor/src/split.rs b/crates/editor/src/split.rsindex b3b3c20ae9a..73a7f1dc4e5 100644--- a/crates/editor/src/split.rs+++ b/crates/editor/src/split.rs@@ -526,6 +526,9 @@ impl SplittableEditor {editor.set_delegate_stage_and_restore(true);editor.set_delegate_open_excerpts(true);editor.set_show_vertical_scrollbar(false, cx);+ editor.disable_lsp_data();+ editor.disable_runnables();+ editor.disable_diagnostics(cx);editor.set_minimap_visibility(crate::MinimapVisibility::Disabled, window, cx);editor});diff --git a/crates/git_ui/src/conflict_view.rs b/crates/git_ui/src/conflict_view.rsindex 6a7432f838d..838ec886fdb 100644--- a/crates/git_ui/src/conflict_view.rs+++ b/crates/git_ui/src/conflict_view.rs@@ -47,6 +47,7 @@ pub fn register_editor(editor: &mut Editor, buffer: Entity<MultiBuffer>, cx: &muif !editor.mode().is_full()|| (!editor.buffer().read(cx).is_singleton()&& !editor.buffer().read(cx).all_diff_hunks_expanded())+ || editor.read_only(cx){return;}