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.
Description
This is a small modification of #2726 where instead of changing the global options, it simply reloads the folds engine.
The original fix was too invasive to user's configuration, which motivated me to make a better hack. It's still a hack, but not as invasive.
I suspect that the issue is caused by a race condition, where the
foldexprisn't valid at the time of opening the file, but is valid after the file is opened, and thus we reload the engine to re-evaluate thefoldexpr. I can't be sure though, a more thorough investigation might be necessary.Fixes #699
Type of change
How Has This Been Tested?
This has been tested with my full config. I don't believe that the config is relevant, and the change itself is very small.
Configuration:
Checklist: