Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Re-render sticky scroll when line numbers display mode is changed#210815

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@timorthi
Copy link
Contributor

@timorthitimorthi commentedApr 20, 2024
edited
Loading

Fixes#210814

This forces a re-render when the line numbers display mode is updated.

This also forces a_readConfiguration call when the display mode changes, as there is a listener registered in_readConfiguration that 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 invscode-vim, which toggles between absolute and relative lines depending on whether you are in insert or normal mode:

fixed.mp4

@aiday-mar
Copy link
Contributor

aiday-mar commentedApr 22, 2024
edited
Loading

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 methodreadConfiguration which would read the configuration, and have another methodreadConfigurationChange which would take in the configuration change event as a parameter. Then you could write:

readConfigurationChange(e : ConfigurationChange) {  this.readConfiguration();  ...  if (e.hasChanged(EditorOption.lineNumbers)) {      this._renderStickyScroll(0);  }}

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:

if (    e.hasChanged(EditorOption.stickyScroll)    || e.hasChanged(EditorOption.minimap)    || e.hasChanged(EditorOption.lineHeight)    || e.hasChanged(EditorOption.showFoldingControls)    || e.hasChanged(EditorOption.lineNumbers))

Should also be placed in the readConfigurationChange method in that case.

@timorthi
Copy link
ContributorAuthor

@aiday-mar Updated!

@timorthi
Copy link
ContributorAuthor

@microsoft-github-policy-service agree

@aiday-mar
Copy link
Contributor

Great thanks!

@aiday-maraiday-marenabled auto-merge (squash)April 23, 2024 07:17
@vscodenpavscodenpa added this to theApril 2024 milestoneApr 23, 2024
@aiday-maraiday-mar merged commit386e1cf intomicrosoft:mainApr 23, 2024
@timorthitimorthi deleted the sticky-scroll-line-updates branchApril 23, 2024 15:57
@microsoftmicrosoft locked and limited conversation to collaboratorsJun 7, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@bpaserobpaserobpasero approved these changes

@aiday-maraiday-maraiday-mar approved these changes

Assignees

@aiday-maraiday-mar

Labels

None yet

Projects

None yet

Milestone

April 2024

Development

Successfully merging this pull request may close these issues.

Sticky Scroll does not update when line numbers display mode is changed

4 participants

@timorthi@aiday-mar@bpasero@vscodenpa

[8]ページ先頭

©2009-2025 Movatter.jp