microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.28k stars 29.31k forks source link

On Scroll jumps to end of file #77645

Closed ARehmanMahi closed 5 years ago

ARehmanMahi commented 5 years ago

Issue Type: Bug

I have my cursor set on first line, but when I scroll the page using mouse wheel it jumps at the end of the file.

This happens when I switch app or after some idle time. After the behvior it starts to work fine untill I stop using the editor and retry after a while to scroll.

I'm working on vue file atm, haven't tested on other files.

VS Code version: Code 1.36.1 (2213894ea0415ee8c85c5eea0d0ff81ecc191529, 2019-07-08T22:55:08.091Z) OS version: Linux x64 4.18.0-25-generic snap

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz (4 x 2720)| |GPU Status|2d_canvas: unavailable_software
flash_3d: disabled_software
flash_stage3d: disabled_software
flash_stage3d_baseline: disabled_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: disabled_software
viz_display_compositor: disabled_off
webgl: unavailable_software
webgl2: unavailable_software| |Load (avg)|1, 1, 2| |Memory (System)|7.50GB (0.63GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (45) Extension|Author (truncated)|Version ---|---|--- html-snippets|abu|0.2.1 project-manager|ale|10.5.2 copy-relative-path|ale|0.0.2 alignment|ann|0.3.0 path-intellisense|chr|1.4.2 bracket-pair-colorizer-2|Coe|0.0.28 vscode-markdownlint|Dav|0.28.0 vscode-eslint|dba|1.9.0 githistory|don|0.4.6 jquerysnippets|don|0.0.1 es7-react-js-snippets|dsz|2.3.0 gitlens|eam|9.8.5 vscode-html-css|ecm|0.2.0 EditorConfig|Edi|0.13.0 vscode-npm-script|eg2|0.3.8 vsc-material-theme|Equ|29.2.0 prettier-vscode|esb|1.9.0 auto-close-tag|for|0.5.6 code-runner|for|0.9.11 gc-excelviewer|Gra|2.1.32 beautify|Hoo|1.5.0 sftp|lix|1.12.7 Angular-BeastCode|Mik|8.0.10 HTMLHint|mka|0.6.0 vscode-docker|ms-|0.7.0 mssql|ms-|1.6.0 python|ms-|2019.6.24221 azure-account|ms-|0.8.4 Go|ms-|0.11.4 vscode-typescript-tslint-plugin|ms-|1.2.2 debugger-for-chrome|msj|4.11.6 vetur|oct|0.21.1 vscode-coldbox|ort|0.1.0 material-icon-theme|PKi|3.8.1 vue-vscode-snippets|sdr|1.7.1 code-settings-sync|Sha|3.4.0 stylelint|shi|0.51.0 code-spell-checker|str|1.7.17 bootstrap4-vscode|the|6.1.0 vscodeintellicode|Vis|1.1.7 vscode-icons|vsc|8.8.0 gitblame|wad|2.8.1 JavaScriptSnippets|xab|1.7.2 markdown-all-in-one|yzh|2.4.0 html-css-class-completion|Zig|1.19.0
mjbvz commented 5 years ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

ARehmanMahi commented 5 years ago

@mjbvz Okay, so I just installed everything on my home PC and so far I haven't seen the issue again. The bug is on my office laptop. As its weekend I'm unable to test it as I don't have the laptop with me. Will check on Monday and let you know. Thanks for reply.

haichaoyu commented 5 years ago

Same problem.

Ubuntu 18.04 Version: 1.36.1 Commit: 2213894ea0415ee8c85c5eea0d0ff81ecc191529

ARehmanMahi commented 5 years ago

Sorry for late reply @mjbvz *So I Installed insider build and the issue persist here as well, No plugins just plain install.

Should I make a screen record of the issue and post it here? I don't know how can I insert video here so, please let me know, if its necessary.

This happens very frequent, every time I switch to other app/window for a minute or two.

rebornix commented 5 years ago

@bsienn a screen recording can definitely help. What happens when you run code-insiders --disable-extensions?

haichaoyu commented 5 years ago

@rebornix Sorry to interrupt your conversation. I does not have the Linux machine at hand now, but on my end, the problem is quite easy to describe.

  1. Open a file in VS Code.
  2. Use Alt+Tab to switch to any other application and then scroll mouse.
  3. Use Alt+Tab to switch back to VS Code.
  4. Slightly scroll mouse wheel (this step is necessary), then all the scrolls I did in another application will get accumulated here to VS Code window. As a result, it suddenly jumps to another line.

PS: I installed two plugins: Bracket Pair Colorizer and Remote VSCode. Both my MacBook and Linux have the exactly same VSCode and plugins, but it works fine on my MacBook.

PPS: For the Linux machine, I have dual monitors. In step 2, scrolls in another monitor does not accumulate. Only scrolls in the same monitor of VSCode count.

ARehmanMahi commented 5 years ago

As the above comment says, its exactly as it says. An other note is, I do have dual setup monitor, and this does happen on my 2nd screen on Ubuntu.

@rebornix I installed insider with no new plugins, but I didn't did disable-extensions. Will try and let you know.

I have PC at home with single monitor, with exactly same plugins, but the issue doesn't reproduce on PC. Only happens in my laptop with dual LCD.

rafaelsms commented 5 years ago

I am using Ubuntu 18.04.2 LTS, Linux kernel x64 4.18.0-25, single monitor. Using code 1.36.1 2213894ea0415ee8c85c5eea0d0ff81ecc191529 x64.

The issue happens fairly easy on all my computers (pc on Arch Linux, new notebook on Ubuntu and old notebook on Arch Linux): change focus to another app, scroll for some time (mouse or touchpad), go back to code. This problem bothers me for some time, I was really surprised that the issue was only opened 10 days ago.

I made a simple vídeo to Youtube using code-insiders on the same computer (OS and kernel specified above) on the version 1.37.0-insider 3802a986823977ec472fc993854e1a753037fc8f x64 and command-line code-insiders --disable-extensions: https://youtu.be/5hd1k_oTa_M

haichaoyu commented 5 years ago

Hi @bsienn, I found this bug also appears when switching between some other apps like Chrome and Files app. Maybe a Ubuntu bug? How about your computer?

alexdima commented 5 years ago

Oh wow, that looks crazy. On our side, we react to mousewheel events and to the scroll values they bring in. We have to use the values given by the events themselves to cover ballistic scrolling via the touchpad...

I think this is an issue in Electron/Chromium. Does the same happen when alt-tabbing from Chromium or another Electron based app like Atom/Slack?

It looks like this was reported before, but we didn't know what to do with them -- #75495 #72949

alexdima commented 5 years ago

Let's track in #28795