Skip to content

fix: issue tracker rule over keyword in subject #1403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Views/CommitSubjectPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,15 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
return;
}

var rules = IssueTrackerRules ?? [];
foreach (var rule in rules)
rule.Matches(_elements, subject);

var keywordMatch = REG_KEYWORD_FORMAT1().Match(subject);
if (!keywordMatch.Success)
keywordMatch = REG_KEYWORD_FORMAT2().Match(subject);

if (keywordMatch.Success)
if (keywordMatch.Success && _elements.Intersect(0, keywordMatch.Length) == null)
_elements.Add(new Models.InlineElement(Models.InlineElementType.Keyword, 0, keywordMatch.Length, string.Empty));

var codeMatches = REG_INLINECODE_FORMAT().Matches(subject);
Expand All @@ -173,10 +177,6 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
_elements.Add(new Models.InlineElement(Models.InlineElementType.Code, start, len, string.Empty));
}

var rules = IssueTrackerRules ?? [];
foreach (var rule in rules)
rule.Matches(_elements, subject);

_elements.Sort();
_needRebuildInlines = true;
InvalidateVisual();
Expand Down
Loading