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

GitLens line info causes horizontal scroll in editor #290

Closed
gwk opened this Issue Feb 18, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@gwk

gwk commented Feb 18, 2018

Just filed an issue with VSCode and want you to be aware as well: Microsoft/vscode#43940

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.

Please read the full report there. In summary, I think that causing unwanted horizontal scroll is something that VSCode should prevent extensions from doing. I want to make GitLens aware of this issue, in case you disagree with my assessment or have additional thoughts. I want to see GitLens succeed, and if the community decides that this detail is actually a feature and not a bug I will respect that, but for me personally it is a flaw that causes more trouble than GitLens is worth.

  • GitLens Version: v8.0.0
  • VSCode Version: Version 1.21.0-insider (1.21.0-insider) 9a4ba7d
  • OS Version: 10.13.4 Beta (17E150g)
@eamodio

This comment has been minimized.

Owner

eamodio commented Feb 19, 2018

I'm going to close this, because as far as I can tell there isn't anything GitLens can do to change this behavior (other than turning off the current line annotation).

See Microsoft/vscode#43940 (comment) for more details.

@fabbballin

This comment has been minimized.

fabbballin commented Mar 12, 2018

@eamodio This only appears to be an issue when the Current Line Blame line is longer than current width of the active editor tab.

Some possible solutions here (besides disabling Current Line Blame) would require modifying how "current line blame" is presented

Some idea's:

  1. Truncate the blame text so that the entire line char count is less than the tab's width, show full blame on hover.
  2. Allow the blame text to be modified (such as removing the or not showing the full file path)
  3. Instead of showing the blame at the end of a line, show a git icon, which would reveal blame info on hover.

Thoughts?

@eamodio

This comment has been minimized.

Owner

eamodio commented Mar 12, 2018

@fabbballin Thanks for thinking more about this.

  1. Truncate the blame text so that the entire line char count is less than the tab's width, show full blame on hover.

Unfortunately I don't know of any way to know the width of the editor/tab. VSCode doesn't provide access to that info, and trying to glean it from line lengths would be prohibitively expensive (especially for large files)

  1. Allow the blame text to be modified (such as removing the or not showing the full file path)

This is possible today, just not exposed through the interactive settings editor (yet -- thinking about it though). See the gitlens.currentLine.format setting. FYI, similar settings exist for the gutter blame and content in the explorer views.

  1. Instead of showing the blame at the end of a line, show a git icon, which would reveal blame info on hover.

This is an interesting idea, and I think it is possible with the api vscode provides (though I know I can't mix text and images -- has to be one or the other). I'll have to look into it more.

Another option which I really like is to provide the hovers over the line numbers (in the gutter), but unfortunately vscode doesn't currently support it. If you think it would be valuable, please up vote this Microsoft/vscode#28080

@skbolton

This comment has been minimized.

skbolton commented Jun 19, 2018

You can actually get their personal settings with this api https://code.visualstudio.com/docs/extensionAPI/vscode-api through the getConfiguration() method. I would love if we could take a crack at fixing this. I could maybe look and try doing a pr

@eamodio

This comment has been minimized.

Owner

eamodio commented Jun 19, 2018

@skbolton This issue is fixed if you use set the gitlens.currentLine.scrollable setting to false. Are you looking for more than just that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment