Fix: named captures indexed incorrectly in multimatches with special line types#8748
Merged
vadi2 merged 1 commit intoMudlet:developmentfrom Jan 6, 2026
Conversation
…line types When multiline triggers use special line types like line spacers, named capture groups were placed in the wrong regex index in the multimatches table. This was caused by the nameCaptures vector not staying synchronized with multiCaptureList. Two fixes: 1. match_line_spacer(): Add empty nameCaptures entry when line spacer matches 2. updateMultistates(): Add else clause to push empty nameCaptures when nameMatches is null for non-first pattern conditions Fixes Mudlet#7989 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
vadi2
approved these changes
Jan 6, 2026
vadi2
pushed a commit
that referenced
this pull request
Feb 3, 2026
…line types (#8748) ## Summary - Fixes named capture groups being placed in wrong regex index in `multimatches` when multiline triggers use special line types (like line spacers) - Root cause: `nameCaptures` vector not staying synchronized with `multiCaptureList` ## Changes 1. `match_line_spacer()`: Add empty `nameCaptures` entry when line spacer matches 2. `updateMultistates()`: Add else clause to push empty `nameCaptures` when `nameMatches` is null for non-first pattern conditions ## Test plan - [x] Build succeeds - [x] All 18 unit tests pass - [x] Manual test with reproduction trigger from issue: - Create multiline trigger with: regex pattern, line spacer, regex with named capture - Verify named captures appear in correct `multimatches[n]` index Fixes #7989 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com> (cherry picked from commit 9fc4be8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
multimatcheswhen multiline triggers use special line types (like line spacers)nameCapturesvector not staying synchronized withmultiCaptureListChanges
match_line_spacer(): Add emptynameCapturesentry when line spacer matchesupdateMultistates(): Add else clause to push emptynameCaptureswhennameMatchesis null for non-first pattern conditionsTest plan
multimatches[n]indexFixes #7989
🤖 Generated with Claude Code