Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimap out of sync with scrollbar #36622

Closed
CzBuCHi opened this issue Oct 20, 2017 · 1 comment
Closed

Minimap out of sync with scrollbar #36622

CzBuCHi opened this issue Oct 20, 2017 · 1 comment
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-minimap Code/Text minimap widget issues

Comments

@CzBuCHi
Copy link

CzBuCHi commented Oct 20, 2017

Not sure if this belongs here but it is issue after all....

Minimap gets out of sync with scroll position. ( left image - u can crearly see, that scrollbar handle is far lower than minimap 'handle' ... )

Also error markers ( in green circle ) are in scope of scrollbar and not minimap ... i usually center minimap view to that red box, get confused for a while and then move to correct place

Can be minimap changed to look similar to Visual Studio (right image) - basically hide 'default' scrollbar and render custom scrollbar with minimap inside?

minimap

@vscodebot vscodebot bot added editor editor-minimap Code/Text minimap widget issues labels Oct 20, 2017
@alexdima
Copy link
Member

Visual Studio

In Visual Studio, the minimap and the scrollbar share the same geometry. For example, in an editor of 800px height, the minimap is always 800px high:

  • if a file has 80 lines, each line gets 10px in the minimap
  • if a file has 800 lines, each line gets 1px in the minimap.
  • if a file has 80000 lines, each line gets ... 0.01px in the minimap.
    This has the consequence that, at one point, the Visual Studio minimap switches to sampling lines.

Visual Studio Code

In Visual Studio Code, the minimap and the scrollbar do not share the same geometry. In Visual Studio Code, each line gets a fixed amount of pixels reserved in the minimap, and the minimap height is made variable. For example, in an editor of 800px height, where each line gets 2px in the minimap (a low DPI display):

  • if a file has 80 lines, the minimap height is 160px
  • if a file has 800 lines, the minimap height is 1600px
  • if a file has 80000 lines, the minimap height is 160000px
    This has the consequence that, at one point, the minimap will also need to scroll.

You can think of the minimap in VSCode as a 10x zoomed-out version of your code. If in the regular editor, a line takes 20px in height, in the minimap a line takes 2px.

You can upvote that we implement the Visual Studio model in #21849

@alexdima alexdima added the *duplicate Issue identified as a duplicate of another issue(s) label Oct 20, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-minimap Code/Text minimap widget issues
Projects
None yet
Development

No branches or pull requests

2 participants