From 6f5d1522cb7b82e47da7e36c7e9e69318dcbe864 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sat, 27 Sep 2025 17:28:37 +0200 Subject: [PATCH] git_ui: Allow splitting `commit_view` pane (#39025) Release Notes: - Allow splitting git commit view pane --- crates/git_ui/src/commit_view.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/crates/git_ui/src/commit_view.rs b/crates/git_ui/src/commit_view.rs index ac00955b6112f2a8b3f9cd963194d76a8217f9c5..4d6be7c5928e8a7c2e2eb2a3bb662f546379771a 100644 --- a/crates/git_ui/src/commit_view.rs +++ b/crates/git_ui/src/commit_view.rs @@ -522,6 +522,29 @@ impl Item for CommitView { editor.added_to_workspace(workspace, window, cx) }); } + + fn clone_on_split( + &self, + _workspace_id: Option, + window: &mut Window, + cx: &mut Context, + ) -> Option> + where + Self: Sized, + { + Some(cx.new(|cx| { + let editor = cx.new(|cx| { + self.editor + .update(cx, |editor, cx| editor.clone(window, cx)) + }); + let multibuffer = editor.read(cx).buffer().clone(); + Self { + editor, + multibuffer, + commit: self.commit.clone(), + } + })) + } } impl Render for CommitView {