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

Horizontal scrolling occurs despite word wrap enabled with GitLens decorations #76458

Closed
sandersaares opened this issue Jul 2, 2019 · 10 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-wrapping Editor line wrapping issues feature-request Request for new features or functionality

Comments

@sandersaares
Copy link
Member

sandersaares commented Jul 2, 2019

Issue Type: Bug

I pressed the "end" key on my keyboard and was surprised to see the viewport scroll horizontally, as I have word wrap enabled. I do not think I have changed anything in the VSCode configuration recently. Presumably this is a regression in a recent VSCode version, as I have not encountered it before (working on the same files on the same PC).

Screenshot of horizontally scrolled viewport after pressing End key on my keyboard:

image

Expected behavior: viewport never scrolls horziontally when word wrap is enabled.

Using font Consolas, so should not be related to proportional fonts.

VS Code version: Code 1.35.1 (c7d83e5, 2019-06-12T14:30:02.622Z)
OS version: Windows_NT x64 10.0.18362

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (8 x 3600)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
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: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.65GB (17.50GB free)
Process Argv --folder-uri file:///c%3A/Source/DASH-IF-IOP
Screen Reader no
VM 0%
Extensions (6)
Extension Author (truncated) Version
xml Dot 2.5.0
gitlens eam 9.8.2
plantuml jeb 2.11.1
azure-pipelines ms- 1.152.0
powershell ms- 2019.5.0
vscode-yaml red 0.4.1
@vscodebot
Copy link

vscodebot bot commented Jul 2, 2019

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

@sandersaares
Copy link
Member Author

Still occurs after updating to latest stable release:

Version: 1.36.0 (user setup)
Commit: 0f3794b38477eea13fb47fbe15a42798e6129338
Date: 2019-07-03T13:25:46.372Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362

@rebornix rebornix added bug Issue identified by VS Code Team member as probable bug editor-rendering Editor rendering issues editor-wrapping Editor line wrapping issues labels Jul 26, 2019
@duncanawoods
Copy link

I have had to abandon vscode for writing markdown because of this so really hope to see a fix soon!

@webdevnerdstuff
Copy link

webdevnerdstuff commented Aug 1, 2019

Please fix this bug already as I personally have been experiencing this for many months now, well before this ticket was created. With word wrap on it should never have a horizontal scroll bar. Sometimes it works, and then you add some code, and then it's broken until you mess around with word wrap on/off again. Sometimes just saving the document causes the horizontal scroll bar to show up. It even happens with the editor in full width with the left drawer closed. There is plenty of space in the code and it doesn't extend the full width, yet it still has the horizontal scroll bar. This is extremely annoying, especially when working on a laptop and scrolling with the track pad.

The other ticket referenced by vscodebot is not applicable.

@alexdima
Copy link
Member

alexdima commented Aug 5, 2019

I cannot easily reproduce this. Does this reproduce when using a monospace font and when disabling all extensions?

Here I am trying with this file: https://github.com/microsoft/vscode/blob/master/README.md

Kapture 2019-08-05 at 11 16 18

@alexdima alexdima added info-needed Issue requires more information from poster and removed bug Issue identified by VS Code Team member as probable bug labels Aug 5, 2019
@duncanawoods
Copy link

duncanawoods commented Aug 5, 2019

It doesn't happen on window resize but when

  • typing a long paragraph, as each line breaks the h-scroll gets borked
  • pressing end on a long line within a paragraph that is at the page width limit

disabling all extensions

I think it might be gitlens. If you look at @sandersaares image, gitlens adds inline text to indicate commits e.g. in the first paragraph you can see light grey text saying you a few seconds ago . uncommitted.

You can see how that spills over the page width but isn't real text so doesn't break across lines. I think that might be causing the issue.

@duncanawoods
Copy link

duncanawoods commented Aug 5, 2019

I can confirm that disabling GitLens>CurrentLine>Enabled to turn off the blame annotation fixes the unwanted horizontal scrolling for me.

I don't know if the wrapping bug from that annotation is a VSCode or a GitLens responsibility.

@alexdima alexdima changed the title Horizontal scrolling occurs despite word wrap enabled Horizontal scrolling occurs despite word wrap enabled with GitLens decorations Aug 5, 2019
@alexdima
Copy link
Member

alexdima commented Aug 5, 2019

Currently, text decorations such as those contributed by GitLens are not taken into account when computing wrapping points.

The text decorations are rendered after the wrapping points have been established and then the horizontal scrollbar is expanded in order to be able to see them.

@alexdima alexdima added feature-request Request for new features or functionality and removed editor-rendering Editor rendering issues info-needed Issue requires more information from poster labels Aug 5, 2019
@duncanawoods
Copy link

duncanawoods commented Aug 5, 2019

The text decorations are rendered after the wrapping points have been established and then the horizontal scrollbar is expanded in order to be able to see them.

That's not what is happening. The horizontal scrollbar is not increased sufficiently to read the annotation. In fact I'm not sure that the annotation needs to even cross the page width for this scrolling issue to occur.

The amount of extra horizontal scroll created is only a single character. This doesn't make annotations visible but it does making typing infuriating because the view continuously rescrolls itself as you write each line and it the resting point is scrolled to the rhs which cuts off the start of all lines meaning you can't properly read what you are typing.

If I was guessing... I would suspect there might be some type of anchor point for the annotation that is changing the rendered width (not the actual annotation) making the content larger than the actual scroll container causing the scrollbar to appear.

@alexdima
Copy link
Member

Let's track in #32856

@alexdima alexdima added the *duplicate Issue identified as a duplicate of another issue(s) label Jan 10, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) editor-wrapping Editor line wrapping issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants