Skip to content

fix: minimap section header display uncompletely on first load:#209603#209605

Merged
alexdima merged 4 commits intomicrosoft:mainfrom
ScriptBloom:scriptbloom/minimap_section_header_fix
Apr 10, 2024
Merged

fix: minimap section header display uncompletely on first load:#209603#209605
alexdima merged 4 commits intomicrosoft:mainfrom
ScriptBloom:scriptbloom/minimap_section_header_fix

Conversation

@ScriptBloom
Copy link
Contributor

Fix This addresses issue: #209603

I am very interested in the Minimap section headers feature, hope to fix this issue with this PR.

After a day of debugging this issue, I finally found out where the bug is. When the editor loads the file for the first time, if the file is too long, the tokens obtained through the getLineTokens interface for the code at the bottom of the first screen window are not accurate, and they will be wrongly filtered out when generating the section header.
Therefore, we need to get more accurate tokens first, and the token index offset calculated from them is accurate, so that the corresponding section header will not be wrongly filtered out.

In addition, this modification will not affect other modules features.

After the fix, minimap section header display completely on first load, like photo below:

vscode_section_header_not_work_when_content_not_in_screen

Thanks for reviewing.

@ScriptBloom
Copy link
Contributor Author

Hi, @alexdima Could you look at this please.

Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@alexdima alexdima enabled auto-merge (squash) April 10, 2024 16:20
@alexdima alexdima merged commit 622b60b into microsoft:main Apr 10, 2024
@alexdima alexdima added this to the April 2024 milestone Apr 10, 2024
@ScriptBloom ScriptBloom deleted the scriptbloom/minimap_section_header_fix branch April 12, 2024 14:23
@microsoft microsoft locked and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants