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

Mouse scrolls editor when Cursor Surrounding Lines is set #4465

Closed
markonius opened this issue Jan 3, 2020 · 1 comment · Fixed by #4481
Closed

Mouse scrolls editor when Cursor Surrounding Lines is set #4465

markonius opened this issue Jan 3, 2020 · 1 comment · Fixed by #4481

Comments

@markonius
Copy link

Describe the bug
When VS Code setting "Editor: Cursor Surrounding Lines" is set, clicking near the top or the bottom of the editor scorlls the view, selecting text as it happens.

To Reproduce

  1. Enable VSCodeVim
  2. Set "Editor: Cursor Surrounding Lines" to some number
  3. Click near the top or the bottom of the view in the editor (file must be scrollable)
  4. Observe annoying scrolling

Expected behavior
Editor shouldn't scroll on click

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.12.4
  • VSCode version: 1.41.1
  • OS: Fedora 30
@cvaldev
Copy link
Contributor

cvaldev commented Jan 8, 2020

This doesn't seem to be reproducible 100% of the time, which leads me to believe it is possibly caused by a race condition between the extension and vscode trying to reveal the same range.

Edit
The above was referring to the selecting text part of the issue, that seems to go away with cursorSurroundingLinesStyle set to all. However, the expected behaviour of cursorSurroundingLinesStyle: default is not being respected.

J-Fields pushed a commit that referenced this issue Jan 9, 2020
Fixes #4465

We currently enforce `scrolloff` on every mouse click which causes us to not respect the default behaviour of cursorSurroundingLines. The default behaviour of cursorSurroundingLines ("editor.cursorSurroundingLinesStyle": "default") is to ignore the scroll offset (https://github.com/microsoft/vscode/blob/master/src/vs/editor/browser/viewParts/lines/viewLines.ts#L574), thus not scrolling on a click event.

VSCode handles revealing a range on a click, I believe it is addressed with https://github.com/microsoft/vscode/blob/71b60d0d2201e5ba0a52d9bd2b914da2cee11ab5/src/vs/editor/browser/viewParts/lines/viewLines.ts#L649, so there is no need for us to also attempt to reveal a range on a mouse selection event. In fact, this creates noticeable issues now that scroll offset is supported by vscode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants