From c0244fbe07c823ec5cbb1de7060b6c21e0e3e950 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 28 Feb 2026 11:33:02 +0800 Subject: [PATCH] enhance: keyword in subject should not contains `"` character Signed-off-by: leo --- src/Views/CommitSubjectPresenter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Views/CommitSubjectPresenter.cs b/src/Views/CommitSubjectPresenter.cs index 65b2f29e..fb1ecac4 100644 --- a/src/Views/CommitSubjectPresenter.cs +++ b/src/Views/CommitSubjectPresenter.cs @@ -257,14 +257,14 @@ namespace SourceGit.Views else { var colonIdx = subject.IndexOf(": ", StringComparison.Ordinal); - if (colonIdx > 0 && colonIdx < 32 && colonIdx < subject.Length - 3 && _elements.Intersect(0, colonIdx) == null) + if (colonIdx > 0 && colonIdx < 32 && colonIdx < subject.Length - 3 && subject.IndexOf('"', 0, colonIdx) == -1 && _elements.Intersect(0, colonIdx) == null) { _elements.Add(new Models.InlineElement(Models.InlineElementType.Keyword, 0, colonIdx + 1, string.Empty)); } else { var hyphenIdx = subject.IndexOf(" - ", StringComparison.Ordinal); - if (hyphenIdx > 0 && hyphenIdx < 32 && hyphenIdx < subject.Length - 4 && _elements.Intersect(0, hyphenIdx) == null) + if (hyphenIdx > 0 && hyphenIdx < 32 && hyphenIdx < subject.Length - 4 && subject.IndexOf('"', 0, hyphenIdx) == -1 && _elements.Intersect(0, hyphenIdx) == null) { _elements.Add(new Models.InlineElement(Models.InlineElementType.Keyword, 0, hyphenIdx, string.Empty)); }