Skip to content

fix(editorconfig): "?" glob matches "/" - #42671

Merged
gpanders merged 1 commit into
neovim:masterfrom
b84330808:editorconfig-question-slash
Nov 6, 2026
Merged

gpanders merged 1 commit into
neovim:masterfrom
b84330808:editorconfig-question-slash

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

Problem

In EditorConfig, ? matches any single character except / (https://spec.editorconfig.org/#glob-expressions). Nvim's glob2regpat() turns it into ., so [som?.c] also applies to som/.c. This is the question_slash case in editorconfig-core-test.

Solution

Replace an unescaped ? with [^/], using a placeholder the same way a single * becomes [^/]*. Added a "?" glob does not match "/" case to test/functional/plugin/editorconfig_spec.lua. It fails without the change and passes with it.

AI-assisted: this change was written with an AI coding agent.

Problem:
EditorConfig "?" matches any single character except "/", but
glob2regpat() turns it into ".", so "[som?.c]" also applies to "som/.c".

Solution:
Replace "?" with "[^/]", the same way single "*" becomes "[^/]*".

AI-assisted
@justinmk

justinmk commented Nov 3, 2026

Copy link
Copy Markdown
Member

@gpanders

@b84330808
b84330808 marked this pull request as ready for review November 4, 2026 16:26
@gpanders
gpanders merged commit 254bec3 into neovim:master Nov 6, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants