-
Notifications
You must be signed in to change notification settings - Fork 764
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
Refactor VimOptionGroupBase #788
Refactor VimOptionGroupBase #788
Conversation
Refactoring - no intentional changes in behaviour
The local value is not unset, but set to a copy of the new value, so we need to make sure that we notify editors that are not "unset"
Refactoring - no intentional changes in behaviour
627d1d5
to
3ba568b
Compare
3ba568b
to
d9f7e5c
Compare
Thank you for the refactoring!
Can I hear about your ideas on how this should work? Also, I see a lot of changes around listeners. JFI, I think at some moment they should be moved from the old observer pattern to the Kotlin flows. |
The changes around listeners here are only about separating responsibilities. I have no other plans for them right now, so don't see any issues with using flow in the future. I'll have a PR ready very soon for |
The
VimOptionGroupBase
class has become a bit of a god class/kitchen sink class. It has too many responsibilities, and is confusing to reason about. It handles setting/getting option values, initialising options for new windows and buffers, notifying listeners of changes and maintaining a cache of parsed effective values (e.g. parsing the contents of'guicursor'
).This PR splits the responsibilities into separate classes that
VimOptionGroupBase
uses. The classes are all implementation details, so remain in the sameVimOptionGroupBase.kt
file, but at least encapsulate responsibilities.The majority of the changes are renames, extracting classes, and other similar refactoring. There is very little behaviour change, although a couple of minor bugs have been fixed.
This refactoring is the basis for the next PR, which will modify the option storage to allow custom options that are powered by IntelliJ settings (e.g.
'wrap'
, based on IntelliJ's soft wrap settings).