Improve setting option values, and add user events #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add user events to allow the user to customize the indentation after the
detection, to fix some options that might be inherited from the initial
configuration. Allows to customize via the configuration which options
are set.
When tabs are detected, set shiftwidth=0 to ensure that the shifting
value is the same as the tabstop. Same with softtabstop=0 to disable it.
When spaces are detected, make optional setting of the tabstop and
softtabstop option.
Use case: In my init.vim I set default indent options for empty files:
When guess-indent detects a file with tabs, it needs to be able to override these values.
Also, I prefer to always keep a tabstop of 8 characters, so I prefer not to have the value changed. And I also prefer to keep the softtabstop option disabled, but if it is enabled when spaces are detected, it needs to be disabled wen tabs are detected.