-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add several updates to vim._with
(tests, granular option contexts, env
context)
#29280
Conversation
37d65a6
to
8b208ff
Compare
77bcbfb
to
cde6619
Compare
vim._with
to allow more granular contextvim._with
(tests, granular option contexts, env
context)
cde6619
to
1632da8
Compare
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.
I haven't checked the test code but I assume they hold the standard echa quality. The option code is somewhat hard to follow, but I'm unsure if there's a good way to simplify it tbh. Maybe we can look into that later. All in all looks great. All the test cases are super valuable.
1a3e025
to
868771c
Compare
868771c
to
15b5f2f
Compare
Problem: `vim._with()` has many different use cases which are not covered with tests. Solution: cover with tests. Some (many) test cases are intentionally marked as "pending" because they cover cases which don't work as expected at the moment (and fixing them requires specific knowledge of C codebase). Use them as a reference for future fixes. Also some of "can be nested" tests currently might pass only because the tested context doesn't work.
Problem: with a single `context.options` there is no way for user to force which scope (local, global, both) is being temporarily set and later restored. Solution: replace single `options` context with `bo`, `go`, `wo`, and `o`. Naming and implementation follows how options can be set directly with `vim.*` (like `vim.bo`, etc.). Options are set for possible target `win` or `buf` context.
15b5f2f
to
cd53db2
Compare
This is super valuable. Thanks for championing this. Follow-up work (not necessarily by you, I'm talking in general): ensure all the tests marked as |
Not only those, I am afraid. Quite a few context fields coming from command modifiers don't seem to work:
Soo... basically most part of the flags :) |
This PR evolved into three improvements:
options
context witho
,bo
,wo
,go
granular contexts. This aligns with existing Lua options terminology and is more flexible than singleoptions
.env
context for environment variables. As this also aligns withvim.env
.More details in commits' messages.
Resolves #29253
Alternative to #29269 and #29268