Skip to content

Commit 6799111

Browse files
committed
revert: revert changes introduced by commit f487990
Signed-off-by: leo <[email protected]>
1 parent e62ab65 commit 6799111

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Views/CommitMessageEditor.axaml.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,23 @@ public void AsStandalone(string file)
1717
{
1818
_onSave = msg => File.WriteAllText(file, msg);
1919
_shouldExitApp = true;
20-
Editor.Text = File.ReadAllText(file).ReplaceLineEndings("\n").Trim();
20+
21+
var content = File.ReadAllText(file).ReplaceLineEndings("\n").Trim();
22+
var parts = content.Split('\n', 2);
23+
Editor.SubjectEditor.Text = parts[0];
24+
if (parts.Length > 1)
25+
Editor.DescriptionEditor.Text = parts[1].Trim();
2126
}
2227

2328
public void AsBuiltin(string msg, Action<string> onSave)
2429
{
2530
_onSave = onSave;
2631
_shouldExitApp = false;
27-
Editor.Text = msg.Trim();
32+
33+
var parts = msg.Split('\n', 2);
34+
Editor.SubjectEditor.Text = parts[0];
35+
if (parts.Length > 1)
36+
Editor.DescriptionEditor.Text = parts[1].Trim();
2837
}
2938

3039
protected override void OnClosed(EventArgs e)

0 commit comments

Comments
 (0)