From 6799111314c9664e218e27c9abdbc14700f77832 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 21 Jul 2025 10:43:52 +0800 Subject: [PATCH] revert: revert changes introduced by commit f487990bc0 Signed-off-by: leo --- src/Views/CommitMessageEditor.axaml.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Views/CommitMessageEditor.axaml.cs b/src/Views/CommitMessageEditor.axaml.cs index d15de55d..868f95b5 100644 --- a/src/Views/CommitMessageEditor.axaml.cs +++ b/src/Views/CommitMessageEditor.axaml.cs @@ -17,14 +17,23 @@ namespace SourceGit.Views { _onSave = msg => File.WriteAllText(file, msg); _shouldExitApp = true; - Editor.Text = File.ReadAllText(file).ReplaceLineEndings("\n").Trim(); + + var content = File.ReadAllText(file).ReplaceLineEndings("\n").Trim(); + var parts = content.Split('\n', 2); + Editor.SubjectEditor.Text = parts[0]; + if (parts.Length > 1) + Editor.DescriptionEditor.Text = parts[1].Trim(); } public void AsBuiltin(string msg, Action onSave) { _onSave = onSave; _shouldExitApp = false; - Editor.Text = msg.Trim(); + + var parts = msg.Split('\n', 2); + Editor.SubjectEditor.Text = parts[0]; + if (parts.Length > 1) + Editor.DescriptionEditor.Text = parts[1].Trim(); } protected override void OnClosed(EventArgs e)