Re-render sticky scroll when line numbers display mode is changed#210815
Merged
aiday-mar merged 3 commits intomicrosoft:mainfrom Apr 23, 2024
Merged
Re-render sticky scroll when line numbers display mode is changed#210815aiday-mar merged 3 commits intomicrosoft:mainfrom
aiday-mar merged 3 commits intomicrosoft:mainfrom
Conversation
Contributor
|
Hi @timorthi thank you for the PR. After looking at the code, I believe the cleanest way to solve this issue would be to refactor the code so that we have a method In this manner the readConfigurationChange method would reuse the readConfiguration method and would add additional logic on top in the form of rerendering the widget under specific conditions. The following check: Should also be placed in the readConfigurationChange method in that case. |
Contributor
Author
|
@aiday-mar Updated! |
Contributor
Author
|
@microsoft-github-policy-service agree |
Contributor
|
Great thanks! |
aiday-mar
approved these changes
Apr 23, 2024
bpasero
approved these changes
Apr 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #210814
This forces a re-render when the line numbers display mode is updated.
This also forces a
_readConfigurationcall when the display mode changes, as there is a listener registered in_readConfigurationthat ensures line numbers are updated as the cursor moves while in relative display mode.Video showing desired behavior after the changes in this PR. This video also shows smart relative lines enabled in vscode-vim, which toggles between absolute and relative lines depending on whether you are in insert or normal mode:
fixed.mp4