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 and/or Minimap Slider isn't correct #50069

Closed
m4xc4v413r4 opened this issue May 17, 2018 · 8 comments
Closed

Minimap and/or Minimap Slider isn't correct #50069

m4xc4v413r4 opened this issue May 17, 2018 · 8 comments
Assignees
Labels
editor-minimap Code/Text minimap widget issues info-needed Issue requires more information from poster

Comments

@m4xc4v413r4
Copy link

Issue Type: Bug

"editor.minimap.enabled": true
"editor.minimap.renderCharacters": true

The minimap slider, more specifically the highlight area it shows of where you are on the code is not the correct position.
I assume that highlight should go from the top line to the bottom line of the visible code in the editor, but it's off by quite a lot.

You can see what I'm talking about in the following picture.
https://i.imgur.com/z3a1jVO.jpg

VS Code version: Code 1.23.1 (d0182c3, 2018-05-10T17:11:17.614Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (8 x 4008)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
video_decode: enabled
video_encode: enabled
vpx_decode: unavailable_software
webgl: enabled
webgl2: enabled
Memory (System) 14.94GB (8.04GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (5)
Extension Author (truncated) Version
gitlens eam 8.3.0
material-icon-theme PKi 3.4.0
todotasks san 0.5.0
wow-bundle Sep 1.2.5
vscode-lua tri 0.12.4
@vscodebot
Copy link

vscodebot bot commented May 17, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added editor editor-minimap Code/Text minimap widget issues labels May 17, 2018
@m4xc4v413r4
Copy link
Author

ok, this is really strange.
Today I open vscode, on the same project, same file, and the minimap highlight is on the correct place.

At first I was completely confused but then I found something strange.
When the "Side Bar" is open, the minimap highlight is correct, when it's closed it's not correct anymore.

Gif example of this happening.

This is making me think that it has something to do with "word wrap" / "max columns".

@alexdima
Copy link
Member

@m4xc4v413r4 I see the problem in your GIF, but I could not reproduce.

I am pressing Ctrl+B and Alt+Z to toggle the sidebar or to toggle word wrap, but I don't observe the slider being off:

I wonder what other settings you have, if this reproduces when extensions are disabled and if this reproduces for any file or only for a specific file.

kapture 2018-05-25 at 16 57 50

@alexdima alexdima added info-needed Issue requires more information from poster and removed editor labels May 25, 2018
@m4xc4v413r4
Copy link
Author

m4xc4v413r4 commented May 25, 2018

@alexandrudima Can you do me a favor and try that with "editor.minimap.renderCharacters": true ?

To be honest I'm not sure of anything anymore.
I just did some more testing, with and without extensions, hiding and showing the Side Bar with mouse and keyboard shortcut, enabling and disabling word wrap, and I'm now more confused than ever.
I don't see consistency, some times the problem is there, some times it's not, other times the problem exists but goes away after closing and opening VSC without changing the settings.

I literally did the exact same thing as my previous gif, with same extensions and same settings, and now there's no problem when toggling the Side Bar.
I tried toggling the wordwrap after that because you menioned it and that breaks it for me again. I never touched it when I originally noticed the problem though, I don't think I ever touched wordwrap since I first turned it on and I've been using VSC since 0.10 or something so a couple of years.

I'mgoing to leave some more gifs here for different thing I tried.
If there's anything specific you want me to try, a specific test or any information I can provide you, feel free to ask for it.

With extensions. With minimap.renderCharacters on:
Toggling Side Bar - Same test i had done on the other gif but not it works fine :/
Toggling WordWrap - Breaks it pretty much the same way I was experiencing before, even though I never toggled wordwrap before. I even toggle the Side Bar at the end and it doesn't change anything, only the wordwrap does.

With extensions. With renderCharacters off:
Toggling Side Bar and WordWrap - The same two tests don't cause problems if renderCharacters is not enabled.

Without extensions every test results in the exact same thing as before:
Toggling Side Bar and WordWrap with and without renderCharacter

So the problem might be between minimap.renderCharacter and word wrapping, maybe even their word wrapping limits (max columns) since we can put a limit on both the editor and the minimap.

My current settings are as following:

{
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe",
"window.zoomLevel": 0,
"editor.wordWrap": "on",
"window.menuBarVisibility": "toggle",
"zenMode.fullScreen": false,
"zenMode.hideTabs": false,
"zenMode.hideStatusBar": false,
"workbench.iconTheme": "material-icon-theme",
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": true,
"editor.minimap.maxColumn": 120,
"editor.insertSpaces": false,
"editor.tabSize": 4,
"editor.detectIndentation": false,
"editor.acceptSuggestionOnEnter": "smart",
"editor.renderWhitespace": "none",
"editor.showFoldingControls": "always",
"extensions.autoUpdate": false,
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
},
"editor.multiCursorModifier": "alt",
"git.enableSmartCommit": true,
"workbench.startupEditor": "newUntitledFile",
"editor.smoothScrolling": false,
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true,
"suppressWelcomeNotice": true
},

"files.trimTrailingWhitespace": true,
"gitlens.blame.ignoreWhitespace": true,
"gitlens.gitExplorer.files.layout": "auto",
"gitlens.keymap": "chorded",

"markdown.preview.scrollEditorWithPreview": false,
"markdown.preview.scrollPreviewWithEditor": false,
"markdown.preview.linkify": true,
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": true
},
"lua.format.lineWidth": 500,
"lua.preferLuaCheckErrors": true,

"editor.fontLigatures": true,
"editor.fontFamily": "Fira Code, Consolas, monospace",
"editor.fontSize": 13,
"editor.fontWeight": "500",
"gitlens.historyExplorer.enabled": true,
"gitlens.codeLens.enabled": false,
"gitlens.hovers.currentLine.over": "line",
"gitlens.mode.statusBar.alignment": "left",
"gitlens.statusBar.alignment": "left",

"editor.minimap.side": "right",
"editor.minimap.showSlider": "mouseover"
}

This includes the extension related settings (the ones in bold), those obviously are irrelevant on the no extensions tests.

@alexdima
Copy link
Member

Do you see any problems in the console? F1 > Developer: Toggle Developer Tools or in the logs F1 > Developer: Show Logs... > Window (VS Code) ?

Do you perhaps have CJK characters in that specific file. It might be a dup of #49378

@m4xc4v413r4
Copy link
Author

No errors, some Violations though (I think the JS ones happened while recording the gif that I have linked at the end here), and found out some more things.

So far all my tests were done with the window using half the screen (I use a 21:9 2560x1080 screen) using Windows Snap feature.

Because I opened the console to test what you wanted I noticed that when I go above a certain width on the VSC window size, the behavior changes (you can actually see when this happens by looking at the minimap), wordwrap doesn't cause a problem anymore, but simply pressing Alt (which toggles the Menu Bar as you probably know) creates the same problem, but on the previous size I was using, pressing Alt doesn't create the problem.

Example of this happening

@alexdima
Copy link
Member

@m4xc4v413r4 I see it happening for you and I have tried and tried, but I am still unable to reproduce. I see that there is a clear point for your setup (when you enlarge the width of VS Code) after which the minimap is off.

But after trying and trying, I could still not reproduce... I wonder if you can perhaps share the file that reproduces it, or if it reproduces on any file for you...

I've even reviewed the source code that computes the minimap layout to look for a possible division by 0 or some other corner case, but I failed to find anything obvious: https://github.com/Microsoft/vscode/blob/7a557d12c961511039d3906c26c76c8556c30909/src/vs/editor/browser/viewParts/minimap/minimap.ts#L216-L296

To rule out some things, can you please disable all extensions, and slowly comment out your settings (including font settings, etc) to try to narrow down what exactly causes it to reproduce...

@vscodebot vscodebot bot closed this as completed Jun 5, 2018
@vscodebot
Copy link

vscodebot bot commented Jun 5, 2018

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-minimap Code/Text minimap widget issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants