Skip to content

Fix crash with file globbing matching micro option names#4044

Open
JoeKar wants to merge 2 commits intomicro-editor:masterfrom
JoeKar:fix/crash-glob
Open

Fix crash with file globbing matching micro option names#4044
JoeKar wants to merge 2 commits intomicro-editor:masterfrom
JoeKar:fix/crash-glob

Conversation

@JoeKar
Copy link
Member

@JoeKar JoeKar commented Mar 14, 2026

The background is documented in: #4042 (comment)

Fixes #4042
Closes #4043

@JoeKar
Copy link
Member Author

JoeKar commented Mar 15, 2026

Closed for better approach.

@JoeKar JoeKar closed this Mar 15, 2026
@JoeKar
Copy link
Member Author

JoeKar commented Mar 16, 2026

Reopen due to #4042 (comment)
We might continue, what was already started.

@JoeKar JoeKar reopened this Mar 16, 2026
@JoeKar JoeKar mentioned this pull request Mar 16, 2026
JoeKar and others added 2 commits March 18, 2026 19:46
Map-typed values in the parsedSettings map do not represent settings for
individual options, they represent maps of settings for multiple options for
the given glob or ft: pattern, and their keys are not option names, they are
glob and ft: patterns. So do not expose them to the callers of ParsedSettings(),
to prevent the callers from mistakenly treating those patterns as option names,
with unpredicted consequences.

Co-authored-by: Dmytro Maluka <dmitrymaluka@gmail.com>
This gives the advantage to differentiate internal options from user defined
file globs with the same name.
}
```

The old non-prefixed glob format is still supported (but internally converted):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This wording sounds like the reader already knows what "old non-prefixed format" this is referring to. As always, put yourself in a position of a reader who is not already familiar with the stuff we are documenting.

And what exactly is the reader supposed to do with "but internally converted"?

...How about:

You can also omit the `glob:` prefix before globs:

...

But it is generally more recommended to use the `glob:` prefix, as it avoids
potential conflicts with option names.

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.

Crash when saving

2 participants