Skip to content

Fix subdirectory .editorconfig files being ignored in certain directory structures#48203

Merged
smitbarmase merged 1 commit intozed-industries:mainfrom
amtoaer:fix_editor_config
Feb 3, 2026
Merged

Fix subdirectory .editorconfig files being ignored in certain directory structures#48203
smitbarmase merged 1 commit intozed-industries:mainfrom
amtoaer:fix_editor_config

Conversation

@amtoaer
Copy link
Contributor

@amtoaer amtoaer commented Feb 2, 2026

Closes #48187

The bug occurred when iterating internal_configs (a BTreeMap sorted by path): the code would break on the first non-matching path, causing configs with lexicographically later paths to be skipped.

For example, when querying "d/d.rs" with configs ["", "b", "d"], iteration would break at "b" (since "d/d.rs" doesn't start with "b"), preventing "d"'s config from being applied.

This PR replaces break with continue to skip non-ancestors, and adds a minor early-exit optimization when config_path > for_path since later paths can't be ancestors.

Release Notes:

  • Fixed subdirectory .editorconfig files being ignored in certain directory structures

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 2, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Feb 2, 2026
Copy link
Member

@smitbarmase smitbarmase left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this! It looks like the bug predates #46332, and the added test is great.

@smitbarmase smitbarmase merged commit b951bd3 into zed-industries:main Feb 3, 2026
29 checks passed
@smitbarmase
Copy link
Member

I've made a few performance tweaks: #48243. Feel free to test it out as well!

@amtoaer
Copy link
Contributor Author

amtoaer commented Feb 3, 2026

I had the same idea but overcomplicated it by trying to implement DoubleEndedIterator for RelPathAncestors. SmallVec is a much simpler solution!

@jrmajor
Copy link

jrmajor commented Feb 4, 2026

Thank you for the fix, now I won't have to temporarily delete one .editorconfig, so that the other one works :)

and the added test is great

Thanks!

adb-sh pushed a commit to adb-sh/zed that referenced this pull request Feb 5, 2026
…tory structures (zed-industries#48203)

Closes zed-industries#48187

The bug occurred when iterating internal_configs (a BTreeMap sorted by
path): the code would `break` on the first non-matching path, causing
configs with lexicographically later paths to be skipped.

For example, when querying "d/d.rs" with configs ["", "b", "d"],
iteration would break at "b" (since "d/d.rs" doesn't start with "b"),
preventing "d"'s config from being applied.

This PR replaces `break` with `continue` to skip non-ancestors, and adds
a minor early-exit optimization when `config_path > for_path` since
later paths can't be ancestors.

Release Notes:

- Fixed subdirectory `.editorconfig` files being ignored in certain
directory structures
naaiyy added a commit to Glass-HQ/Glass that referenced this pull request Feb 16, 2026
Key changes:
- Reduce monomorphizations in GPUI app.rs (zed-industries#48014)
- Entities no longer implement Element directly, go through AnyElement (zed-industries#48217)
- D3D11 resource upload optimization (zed-industries#48282)
- Migrate features.edit_prediction_provider to edit_predictions.provider (zed-industries#48224)
- Make mercury and sweep non-experimental (zed-industries#48227)
- CompanionView consolidation in block_map (zed-industries#48223)
- Show memory used by language servers (zed-industries#48226)
- Settings links open sub pages (zed-industries#48212)
- Tool security rules that can't be overridden (zed-industries#48209)
- Add sweep_ai privacy mode setting (zed-industries#48220)
- Configurable REPL output size limits (zed-industries#47114)
- Fix .editorconfig files in subdirectories (zed-industries#48203)
- Security updates: bytes v1.11.1, jsonwebtoken v10
- Git UI: hide "View on GitHub" for stashes (zed-industries#48271)
- Indent guide fix in tree view with collapsed folders (zed-industries#48194)
- Edit prediction fixes and improvements

Conflict resolution:
- collab/completion.rs, collab/rpc.rs: deleted (collab removed)
- vim/search.rs: deleted (vim removed)
- livekit_api/Cargo.toml: deleted (livekit removed)
- GPUI files: deleted from Glass (handled in Obsydian-HQ/gpui)
- migrations: combined both ours (m_2026_02_06) and upstream (m_2026_02_02, m_2026_02_03)
- project.rs: kept collab functions removed, restored handle_create_file_for_peer for remote dev
- lsp_store.rs: removed collab-only set_language_server_statuses_from_proto
- proto.rs: kept CreateFileForPeer, removed CreateChannel/CreateChannelResponse
- remote_servers.rs: merged import lists (kept native button imports + added Action)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.editorconfig in subdirectory is sometimes ignored

3 participants