git_ui: Allow splitting commit_view pane (#39025)

Release Notes:

- Allow splitting git commit view pane
This commit is contained in:
Lukas Wirth
2025-09-27 15:28:37 +00:00
committed by GitHub
parent 682cf023ca
commit 6f5d1522cb
+23
View File
@@ -522,6 +522,29 @@ impl Item for CommitView {
editor.added_to_workspace(workspace, window, cx)
});
}
fn clone_on_split(
&self,
_workspace_id: Option<workspace::WorkspaceId>,
window: &mut Window,
cx: &mut Context<Self>,
) -> Option<Entity<Self>>
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 {