Search code examples
visual-studio-codescrollselection

How to auto-scroll while selecting a long single line in VS Code with a mouse? Currently, it jumps to the end or beginning when reaching a screen edge


In VS Code, when I am not in wrap wrap mode, often lines will go off the screen to the right. If I start selecting the line and the selection goes to the right of the window I would expect the text to start to scroll to the left as I continue to select more. This is how Atom works and any other editor I have used.

Instead, VS Code is jumping to the end of the line and selecting it all. Note, I am not accidentally putting my cursor to the next line. If I start deselecting, as I deselect past the left edge, it jumps back to show the start. This is very annoying if I want to end the selection somewhere in the middle of the long line which is quite often.

I would prefer to see the line scroll by as I am selecting. Surely, there must be a setting to turn off that auto-to-the-end effect but I can't find it.


Solution

  • This is a regression bug in VS Code. See this issue ticket: Editor mouse selection scrolling isn't smooth #172652. You can show your support for the issue ticket by giving a thumbs up reaction to the issue. But please don't make a "me too" comment. "me too" comments generally come off as annoying to repo maintainers because they clutter up discussion and don't contribute anything of significant value.

    I'm not aware of there being a setting to control this either. But in any case, just wait for the bug-fix.

    As a current workaround, you can do your selection via keyboard (navigation keys while holding shift and other modifiers as needed), or use your scroll-wheel to manually scroll (Ex. holding shift and scrolling, which causes horizontal scrolling).