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)