-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/docs(editorconfig): add support for spelling_language #28638
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on first glance, thanks! Will give it a test whenever you mark it ready for review.
Can you please also update |
The `test_case` method presumed that all options set by editorconfig were *buffer-local* so it called `nvim_get_option_value` with `{ buf = 0 }` even for *window-local* options such as `spell`. Now `nvim_get_option_info2` is used to get the scope of the option. This scope can be: "global", "win" or "buf".
Looks like I forgot to add some parameters. It's weird because when I ran |
A *GOOD* example of spelling_language is en-US. ('-' must be used as a separator) A *BAD* example of spelling_language is en/US or en_US.
spelling_language = en | ||
|
||
[long_spelling_language.txt] | ||
spelling_language = en-US |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should test something other than the default
c63c911
to
af67eb2
Compare
These were changed to use something other than the default values.
This fixes #28626.
For the other editorconfig properties it's easier to check for validity since they are either a number or part of an enum with few elements. The problem for
spelling_language
is that it is part of a greater enum since it's a concatenation of a ISO 639 language code and an optional ISO 3166 territory identifier.For now the code only checks that the value provided in
spelling_language
is of the format [a-z][a-z] or [a-z][a-z]-[a-z][a-z] (regex), but it doesn't check whether it is a valid ISO639/ISO3166 code and thus when inputting an invalid value thespelllang
option is also set to an unknown language (this results in a prompt asking you to download the unknown language and then failing and continuing if accepted).