Skip to content

project: Add CRLF regex search integration test#1

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/bump-fancy-regex-to-0-18-0
Draft

project: Add CRLF regex search integration test#1
Copilot wants to merge 2 commits into
mainfrom
copilot/bump-fancy-regex-to-0-18-0

Conversation

Copy link
Copy Markdown

Copilot AI commented May 1, 2026

The .crlf(true) RegexBuilder option (added alongside the fancy-regex 0.18.0 bump) makes ^/$ anchors in multiline mode match before \r\n pairs, not just bare \n. Without it, patterns using $ anchors silently fail to match in CRLF files.

Important nuance uncovered during testing: .crlf(true) in fancy-regex only affects ^/$ anchors and . — it does not make \n in a pattern match \r\n. Cross-line patterns targeting CRLF files should use \r?\n to handle both endings.

Changes

  • Adds test_multiline_regex_crlf to crates/project/tests/integration/search.rs, covering the pattern ^hello$\r?\n against CRLF text. The $ + .crlf(true) anchors correctly before \r\n; without CRLF mode the \r prevents $ from firing and the pattern never matches.
  • Moves the use language::Buffer import from inside each test function to file-level.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • N/A

Copilot AI and others added 2 commits May 1, 2026 12:44
Agent-Logs-Url: https://github.com/forkeith/zed/sessions/368f2b32-2b37-4960-85e6-2f7aeb5003bb

Co-authored-by: keith-hall <11882719+keith-hall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/forkeith/zed/sessions/9dccafe2-b436-48c2-893b-760fb1c97827

Co-authored-by: keith-hall <11882719+keith-hall@users.noreply.github.com>
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.

2 participants