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
8.97k stars 1.3k forks source link

Blame gutter annotation issue when commit contains emoji #146

Closed eMerzh closed 7 years ago

eMerzh commented 7 years ago

Hi, Thanks for your work on this extension! really great ... it seems that i encounter a small bug (i first thought it was normal :p ) with the "File annotation" feature with commit that contains emojis it's probably a char count issue or smth like that

Steps to Reproduce: Have commit with and without emojis like here

image
fgallardograzio commented 7 years ago

I can also reproduce this same issue with a seemingly plain old text-only commit message. Here's a screenshot:

screenshot-gitlens-vscode

This is the commit that is causing the issue. The file in the screenshot is src/controllers/user.ts. This is the blamed file on GitHub.

Awesome extension, btw!


eamodio commented 7 years ago

@eMerzh @fgallardograzio the latest GitLens v5 beta should fix this as best I can -- the heatmap edge should no longer break, but the right-aligned text could be a little jagged although much better than before.

Please follow these instructions to install a pre-release. Let me know if you experience any issues -- thanks!

fgallardograzio commented 7 years ago

There's an issue with consecutive whitespace characters (spaces, tabs, etc) in the gutter annotation.

This happens whether the spaces are in the gutter annotation format, e.g:

"gitlens.annotations.file.gutter.format": "${author|10}      ${message|30?} ${ago|14-}"

or if they're from the commit message itself, e.g:

git commit -m "Message with    spaces    !"

(I've added  s here so that github's markdown would not get in the way, but in the actual format string and commit message they were just regular spaces).

This is what it looks like using the format string from the first example:

image

Edit: OK, just saw your commit. Let me check if that fixes this issue as well! :smiley:

eamodio commented 7 years ago

@fgallardograzio is that with the latest beta?

fgallardograzio commented 7 years ago

@eamodio Just installed v5.2.0-beta. Heatmap is perfectly straight! Right aligned text in line 5 (which was broken before) is pushed a few pixels to the left as you predicted.

However this behaviour is accentuated in my "commit message with spaces" example. In the screenshot below you can see the commit command in the console, and the result in the blame annotation.

image

Additional consecutive spaces in the format string (gitlens.annotations.file.gutter.format) are collapsed. No matter how many spaces there are, they're rendered like one, and nothing is misaligned.

eamodio commented 7 years ago

Great -- thank you! I'll dig into the space collapsing issue.

eMerzh commented 7 years ago

Looks perfect now :)

Thanks for the update

github-actions[bot] commented 3 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.