diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index bf19ecc7..031d6e77 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -89,21 +89,25 @@ namespace SourceGit.Views matches.Sort((l, r) => l.Start - r.Start); _matches = matches; - int pos = 0; + var inlines = new List(); + var pos = 0; foreach (var match in matches) { if (match.Start > pos) - Inlines.Add(new Run(message.Substring(pos, match.Start - pos))); + inlines.Add(new Run(message.Substring(pos, match.Start - pos))); var link = new Run(message.Substring(match.Start, match.Length)); link.Classes.Add(match.IsCommitSHA ? "commit_link" : "issue_link"); - Inlines.Add(link); + inlines.Add(link); pos = match.Start + match.Length; } if (pos < message.Length) - Inlines.Add(new Run(message.Substring(pos))); + inlines.Add(new Run(message.Substring(pos))); + + Inlines.AddRange(inlines); + InvalidateTextLayout(); } } diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index a0828459..c2507721 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -212,22 +212,24 @@ namespace SourceGit.Views matches.Sort((l, r) => l.Start - r.Start); _matches = matches; - int pos = 0; + var inlines = new List(); + var pos = 0; foreach (var match in matches) { if (match.Start > pos) - Inlines.Add(new Run(subject.Substring(pos, match.Start - pos))); + inlines.Add(new Run(subject.Substring(pos, match.Start - pos))); var link = new Run(subject.Substring(match.Start, match.Length)); link.Classes.Add("issue_link"); - Inlines.Add(link); + inlines.Add(link); pos = match.Start + match.Length; } if (pos < subject.Length) - Inlines.Add(new Run(subject.Substring(pos))); + inlines.Add(new Run(subject.Substring(pos))); + Inlines.AddRange(inlines); InvalidateTextLayout(); } }