Improve foldfix performance and potentially fix some bugs(#1855 #2163) #2867
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.
What this PR does / why we need it:
Improved the foldfix setting behaviour for improved performance, reduced bugs, and hopefully easier extension and addition of more fold commands in the future.
Which issue(s) this PR fixes
Should fix #1855 and fix #2163, though it may require more testing.
gulp test
passed all tests with and without forcingconfiguration.foldFix
totrue
, but more tests may need to be added.Special notes for your reviewer:
One bug this may have introduced is flickering when prefixing a downward movement command with a large repeat. This is indicated in a comment inside
MoveDownFoldFix
but is still much better behaviour than before where an infinite loop would begin. To fix it we would need a more reliable way to detect the last visual line of a file (must account for both wrapped lines and folds).