-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
When editor text wrap is enabled, extensions should never cause horizontal scrolling. #43940
Comments
Also filed with GitLens: gitkraken/vscode-gitlens#290 |
Unfortunately I don't think there is anything GitLens (or any extension that uses an after decoration) could do to prevent this. I played with changing the DecorationRangeBehavior but I didn't see any change. I feel like this changed somewhat recently -- where after decoration now affect scrolling. FWIW, I prefer that they affect scrolling, but they should honor the editor wrapping if they do. Also related if an after decoration causes a line to grow and cause the scrollbars to appear, when the decoration is removed, the scrollbars don't go back to the previous state. |
Currently, inline decorations (such as CSS color boxes or git lens decorations) are implemented via CSS :before / :after selectors and they are unknown to the editor. |
As a hack, when the editor is in word-wrap mode, maybe the :after can be |
@eamodio That is a good thought, but I think that would not work for all possible types of |
Ah, right. I forget you can have them anywhere :) |
Let's track in #32856 |
Steps to Reproduce:
With the default settings, Gitlens draws text at the end of the current line showing git blame info.
This causes the line length to exceed that of the window, thereby enabling horizontal scrolling.
Note that horizontal scrolling is not possible, even with wrapping lines, until the first time gitlens takes this action and causes an overflow. The only recourse I see is to reload the editor window, but it's just a temporary fix until gitlens does it again.
I think this is a design problem with the core VSCode editor. I do not want the editor to scroll horizontally, ever, unless wrapping is disabled. That an extension can cause the core UI to switch into a fundamentally different (and annoying) mode seems to me a flaw in the editor itself. The alternative is to blame the extension; perhaps there is some way of configuring GitLens to prevent this but I have tried and haven't found it yet. To reiterate, it seems reasonable to ask that the editor not allow extensions to break the basic layout constraint that the editor does not scroll horizontally.
The reason this is so annoying is that once horizontal scroll is enabled, then when I scroll vertically with the trackpad I tend to shift the horizontal scroll slightly, thereby visually clipping the left side of the document by a character or two. Even after coping with this for months, I still get thrown off by it.
Does this issue occur when all extensions are disabled?: Not sure. Currently the repo depends on an extension, but it seems like something that the core should prevent.
The text was updated successfully, but these errors were encountered: