vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Change horizontal scrolling to scroll the window

Open aroemen opened this issue 10 years ago • 23 comments

Currently when scrolling horizontally with a touchpad it moves the position of the cursor. Can there be an option added to scroll the window verses just moving the cursor?

aroemen avatar Dec 11 '15 15:12 aroemen

fyi: @alexandrudima

egamma avatar Dec 11 '15 19:12 egamma

@aroemen What OS are you using and what laptop brand. Sometimes, the trackpad gestures are implemented in funny ways (e.g. they send ArrowLeft/ArrowRight key down events instead of scroll events).

alexdima avatar Dec 12 '15 10:12 alexdima

@alexandrudima I have it happening on multiple computers and OSes. One is a HP running Windows 10 and the other is an IBM running Windows 7

aroemen avatar Dec 15 '15 23:12 aroemen

my Lenovo's w530 trackpad scrolls horizontally instead of moving cursor.

@aroemen What happens if you open a webpage with a native textarea with a horizontal scrollbar in Chrome and use the horizontal scroll gesture? I've made such an example at https://jsfiddle.net/n5ego3fs/

Does Chrome move the cursor too or just scrolls? What do other browsers do? (it might be a Chrome bug)

alexdima avatar Dec 16 '15 14:12 alexdima

@alexandrudima in Chrome, it is scrolling the viewing area. Here is a screencast showing the differences between jsfiddle page and vscode.http://screencast.com/t/CFbXK1wv

aroemen avatar Dec 16 '15 17:12 aroemen

@alexandrudima - horizontal scrolling appears to be working now after updating.

aroemen avatar Jan 05 '16 19:01 aroemen

This issue is not resolved.

saborrie avatar Jul 14 '16 14:07 saborrie

I have this issue too in version 1.3.1 on Windows 8.1 on a Lenovo T44p laptop. The jsFiddle textarea scrolls correctly while VSCode doesn't.

To avoid this issue, I need to use the Softwrap extension and have it activated all the time.

jflheureux avatar Jul 14 '16 22:07 jflheureux

@jflheureux Does scrolling in Chrome in the editor at https://microsoft.github.io/monaco-editor/ work for you? If yes, then it might be only a matter of time until we catch up (we are on Chromium 49) and Chrome is at 51.

alexdima avatar Jul 15 '16 08:07 alexdima

I have the same issue with horizontal scrolling when using shift + right arrow key to highlight characters and curser is moved to the right with on a single line of code that extends beyond the right of the viewport, the screen does not follow it.

  • VSCode Version: Code 1.8.1 (ee428b0eead68bf0fb99ab5fdc4439be227b6281, 2016-12-19T14:49:23.350Z)
  • OS Version: Windows_NT ia32 10.0.14393

jimfrenette avatar Dec 28 '16 14:12 jimfrenette

I have the same issue with horizontal scrolling. Sometimes (quite seldom and I can't reproduce the behaviour), the window is rather scrolled. But most of the time, it is the cursor that is moved, even if the mouse pointer is on another editor in same vscode window.

  • VSCode version: 1.8.1
  • OS version: Microsoft Windows [Version 10.0.14393]

Odame avatar Jan 08 '17 16:01 Odame

This issue is NOT resolved. I am reporting identical symptoms. Tried scrolling in Chrome in the editor at https://microsoft.github.io/monaco-editor/ and over there it reacts as I would expect - scrolling the viewport and not moving the cursor.

VSCode version: 1.10.1 OS version: Microsoft Windows [Version 10.0.14393.693]

stereokai avatar Mar 08 '17 02:03 stereokai

I use the "Home" and "End" keys a lot to move cursor position. When I do this, the window scroll position does not change, and my cursor goes out of view. I have to press the Left or Right arrow to get window scroll to bring cursor into viewport.

Noitidart avatar Mar 29 '17 06:03 Noitidart

This is an upstream issue (possibly within Chromium), and there are no known workarounds that we could implement on our side. This means there is no possible code change for us to do in VS Code sources to improve things.

To keep the number of issues in our inbox at a manageable level, we’re closing issues that have been on the backlog for a long time but haven’t gained traction or that are not actionable. Thank you for your time and understanding.

alexdima avatar Nov 24 '17 14:11 alexdima

@alexandrudima can you share with the community the Chromium bug?

stereokai avatar Nov 27 '17 09:11 stereokai

@stereokai I cannot reproduce this behaviour on my laptop. That is why I ask that someone who can reproduce create an issue with Chromium.

alexdima avatar Nov 27 '17 10:11 alexdima

I don't mean to be rude, but I want to ask you - what makes you think this is a Chromium bug? The text editor is a JS implementation after all - not a native text area

stereokai avatar Nov 27 '17 14:11 stereokai

Same issue and the monaco editor scrolls horizontally no problem

jongood01 avatar Nov 29 '17 08:11 jongood01

@stereokai Because of the code we wrote where the cursor moves left or right when we receive a keydown event for arrow left or arrow right and not when we receive a scroll or mousewheel event (which are the events a trackpad should generate).

Please build VSCode locally with the following diff in /src/vs/platform/keybinding/common/abstractKeybindingService.ts:

image

This will show on your machine in the developer console what kind of keydown event (most likely arrow left / arrow right) is produced when using the trackpad.

alexdima avatar Nov 29 '17 08:11 alexdima

@alexandrudima I'll give that a try. Perhaps there is something to do about it in VSCode, because the bug is not reproduced in Monaco itself.

stereokai avatar Nov 29 '17 11:11 stereokai