Skip to content

fix(chromaterm): replace alternation in lookbehinds for PCRE2 compat#18

Merged
AnExiledDev merged 1 commit intomainfrom
fix/chromaterm-regex
Feb 26, 2026
Merged

fix(chromaterm): replace alternation in lookbehinds for PCRE2 compat#18
AnExiledDev merged 1 commit intomainfrom
fix/chromaterm-regex

Conversation

@AnExiledDev
Copy link
Owner

@AnExiledDev AnExiledDev commented Feb 26, 2026

Summary

  • PCRE2 requires fixed-length lookbehinds, but chromaterm.yml used variable-length alternation patterns
  • File path regex: (?<=[\s(]|^)(?:(?<=[\s(])|^) (zero-width ^ can't mix with \s()
  • Git hash regex: (?<=commit |merge |pick |revert |fixup ) → individual lookbehinds in non-capturing group

Closes #15

Test plan

  • ct parses the updated YAML without errors
  • File paths like src/main.py:42 still highlight correctly
  • Git commit hashes after commit, merge, pick, revert, fixup still highlight

Summary by CodeRabbit

  • Bug Fixes
    • Resolved regex pattern compatibility issues to achieve better PCRE2 standard compliance. Updated pattern matching for file paths and git commit information to ensure more reliable and consistent recognition. These improvements enhance pattern detection robustness and prevent edge cases throughout the application.

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c74cce3 and 97b4506.

📒 Files selected for processing (2)
  • .devcontainer/CHANGELOG.md
  • .devcontainer/features/chromaterm/chromaterm.yml

📝 Walkthrough

Walkthrough

Two regex patterns in the ChromaTerm configuration were updated to fix compatibility with Python's re module, which requires fixed-width lookbehinds. A changelog entry documents these fixes.

Changes

Cohort / File(s) Summary
ChromaTerm Regex Fixes
.devcontainer/features/chromaterm/chromaterm.yml
Updated file path and git commit patterns to replace variable-width lookbehinds with non-capturing groups containing individual fixed-width lookbehinds, resolving Python re module compatibility errors.
Documentation
.devcontainer/CHANGELOG.md
Added Fixed section for Unreleased documenting the ChromaTerm regex compatibility resolution.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A regex pattern, twisted just right,
Fixed width lookbehinds now in sight,
No more errors on startup's call,
The rabbit's debug work fixes all! 🔧✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely describes the main fix: replacing alternation in lookbehinds for PCRE2 compatibility, which is the primary objective of this pull request.
Linked Issues check ✅ Passed The pull request successfully addresses all coding requirements from issue #15: both regex patterns have been corrected to use individual fixed-width lookbehinds within non-capturing groups, eliminating Python re.errors and preserving existing highlighting functionality.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the two identified regex patterns in chromaterm.yml and documenting the fix in CHANGELOG.md, with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/chromaterm-regex

Comment @coderabbitai help to get the list of available commands and usage tips.

PCRE2 requires fixed-length lookbehinds. The file path regex used
`(?<=[\s(]|^)` (variable-length alternation) and the git hash regex
used `(?<=commit |merge |...)` (different-length alternatives).

Replaced with non-capturing groups containing individual fixed-length
lookbehinds that satisfy the PCRE2 constraint.

Closes #15
@AnExiledDev AnExiledDev merged commit 14a302e into main Feb 26, 2026
1 check passed
@AnExiledDev AnExiledDev deleted the fix/chromaterm-regex branch February 26, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ChromaTerm: regex lookbehind errors on startup

1 participant