Skip to content

Fix parsing of filenames like main (1).log#50770

Merged
Veykril merged 2 commits intozed-industries:mainfrom
hagz0r:fix/windows-open-parenthesized-filename
Mar 10, 2026
Merged

Fix parsing of filenames like main (1).log#50770
Veykril merged 2 commits intozed-industries:mainfrom
hagz0r:fix/windows-open-parenthesized-filename

Conversation

@hagz0r
Copy link
Copy Markdown
Contributor

@hagz0r hagz0r commented Mar 5, 2026

Summary

Fixes Windows file-open parsing for names like main (1).log.

PathWithPosition::parse_str could treat (1) in a normal filename as a position suffix and drop the extension/path tail. The regex is now anchored so parenthesized row/column parsing only applies at the end of the filename (with optional trailing : and optional range suffix).

Testing

  • cargo test -p util path_with_position_parse_

Closes #50597

Release Notes:

  • Fixed opening files with names like main (1).log on Windows.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Mar 5, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @hagz0r on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Mar 5, 2026
@hagz0r
Copy link
Copy Markdown
Contributor Author

hagz0r commented Mar 5, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @hagz0r on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla_bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 5, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Mar 5, 2026

The cla-bot has been summoned, and re-checked this pull request!

@hagz0r
Copy link
Copy Markdown
Contributor Author

hagz0r commented Mar 8, 2026

Just a gentle ping in case this got buried.
Happy to make changes if needed.
@MrSubidubi @Veykril

Comment on lines +598 to +600
(?:
-\(\d+(?:[,:]\d+)?\) # filename:(row,column)-(row,column), filename:(row,column)-(row)
)?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit seems unnecessary / should not be part of this bug fix?

@hagz0r
Copy link
Copy Markdown
Contributor Author

hagz0r commented Mar 9, 2026

You were right, I applied the fix and waiting for your approval
image

@Veykril
Copy link
Copy Markdown
Member

Veykril commented Mar 10, 2026

Thanks!

@Veykril Veykril enabled auto-merge (squash) March 10, 2026 06:41
@Veykril Veykril merged commit d1a323b into zed-industries:main Mar 10, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zed does not open files with space in them

2 participants