gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
9.01k stars 1.34k forks source link

Three dots are appearing and disappearing on editor because of GitLens. #1312

Closed ankitjainhere closed 2 years ago

ankitjainhere commented 3 years ago

Steps to Reproduce:

  1. Start writing something on editor, three dots appears and disappears after some seconds. This looks too annoying because whole code shifts down and up after again and again. I tried installing some previous versions of GitLens but this is still issue there.

For reference go to this link ( someone reported same issue on vscode repository ): [https://github.com/microsoft/vscode/issues/111472#issue-752993771]()

thisisrandy commented 2 years ago

It appears that gitlens uses an ellipsis as a placeholder for "Recent change" information. If that feature is enabled, text along the lines of "AUTHOR, TIME ago | X authors (AUTHOR)" appears at the top of files and code blocks. When the user begins editing the file, that text appears to be replaced with "...". A few seconds after the user has stopped editing, gitlens seems to refresh and display the (potentially updated) recent change text.

The problem arises when a file is untracked. Since there is no recent change information to speak of, gitlens does not display it. However, if the top of the file is visible, a file-level ellipsis is displayed when editing, which causes a new line to appear and the code on-screen to jerk down and then back up again once editing has ceased. A stack overflow user suggested that disabling the recent changes feature will fix this, but it does not.

This is hopefully a simple fix: before taking any action to modify display, gitlens could simply check if the file in the focused editor pane is being tracked and do nothing if not. Might someone who knows the code dig in and make the fix?

eamodio commented 2 years ago

Duplicate of https://github.com/gitkraken/vscode-gitlens/issues/1742

thisisrandy commented 2 years ago

Confirmed fixed in v12.0.1.

moop-moop commented 2 years ago

Seem to be back in v12.0.5

eamodio commented 2 years ago

@moop-moop Can you capture a video of what you are seeing?

xiangnanscu commented 2 years ago

@eamodio see mine https://github.com/microsoft/vscode/issues/146379

xiangnanscu commented 2 years ago

I confirm the version is v12.0.5

eamodio commented 2 years ago

@xiangnanscu

The existance of ... is by design -- because once you start editing the file the blame CodeLens become "invalid", and if I remove them the file will jump around, so I replace them with ... until the file is saved or 5s has passed since the last edit. If you want to avoid the ... you can decrease the default (5s) timeout using the "gitlens.advanced.blame.delayAfterEdit" setting. This can avoid the ... and update the CodeLens more quickly, but it will cause more processing to because it will have to more regularly re-compute the blame.

You can also control the string (e.g. ...) that shows up in this case too: "gitlens.strings.codeLens.unsavedChanges.authorsOnly": "$(loading~spin)", "gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors": "$(loading~spin)", "gitlens.strings.codeLens.unsavedChanges.recentChangeOnly": "$(loading~spin)",

Setting it to the above will cause it to look like a loading spinner. Or you can set it to an empty string, or whatever.

But the ... shouldn't show up, and then completely disappear causing the file to jump, which is what this bug was about.

xiangnanscu commented 2 years ago

@eamodio OK. thanks for the tip.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.