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

Full-width characters break gutter annotations #135

Closed
20chan opened this issue Aug 29, 2017 · 15 comments
Closed

Full-width characters break gutter annotations #135

20chan opened this issue Aug 29, 2017 · 15 comments
Labels
bug Something isn't working

Comments

@20chan
Copy link

20chan commented Aug 29, 2017

  • GitLens Version: 4.4.1
  • VSCode Version: 1.15.1
  • OS Version: Windows 10

Screenshot

When commit message contains fullwidth chracter happens.

@eamodio
Copy link
Member

eamodio commented Aug 29, 2017

This is a duplicate of #107 and sadly it depends on the font used.

@eamodio eamodio closed this as completed Aug 29, 2017
@20chan
Copy link
Author

20chan commented Aug 29, 2017

I'm using monospace font but it doesn't work. Isn't there any way to calculate length of string using full-width character as two character?

@eamodio
Copy link
Member

eamodio commented Aug 29, 2017

Unfortunately as I understand it (from the vscode issue around it) only certain monospace fonts actually render full-width characters as double-width. If the font does, like Inconsolata, then it works, otherwise it won't. But AFAIK, there is nothing I can do as a vscode extension to get that to work -- maybe it is something vscode can do, but again I don't know. Here is the vscode issue: microsoft/vscode#14589

@20chan
Copy link
Author

20chan commented Aug 29, 2017

I think you didn't understane what's the problem. I'm using monospace font, and it works.
screenshot
What I want to tell you is, you shouldn't pad just using length of string. Maybe you should use isHalfWidth in eastasianwidth or something to pad actual length of string.

@eamodio
Copy link
Member

eamodio commented Aug 30, 2017

@Phillyai can you try the Inconsolata font and see if you are still having an issue?

I am currently using the string-width library to calculate the width of the line to pad it. string-width looks to be almost the same as the east-asian-width library.

@eamodio eamodio reopened this Aug 30, 2017
@20chan
Copy link
Author

20chan commented Aug 30, 2017

screenshot
Inconsolata used, still have issue.

> s=require('string-width')
[Function]
> s('가나다')
6

And also string-width seems working well.

@eamodio
Copy link
Member

eamodio commented Aug 30, 2017

@Phillyai is this a public repo that I can try out for myself? Also can you try setting: "gitlens.annotations.file.gutter.compact": false to see if you see the same behavior?

Also if you are interested I have a GitLens slack -- might be easier to talk about this.

@20chan
Copy link
Author

20chan commented Aug 30, 2017

  1. Sure, yes. Also there are many repository contains korean commit messages not only this. https://github.com/phillyai/bumble
  2. Sadly, yes.
    screenshot

@20chan 20chan closed this as completed Aug 30, 2017
@eamodio eamodio reopened this Aug 30, 2017
@eamodio
Copy link
Member

eamodio commented Aug 30, 2017

@Phillyai I think I see the issues. One is with the compact mode where I wasn't using string-width, and the other is my truncation function doesn't work properly with full-width characters.

@eamodio eamodio changed the title Fullwidth characters make broken line width on file blame annotation Full-width characters break gutter annotations Aug 30, 2017
@eamodio
Copy link
Member

eamodio commented Aug 30, 2017

@Phillyai Just released v4.4.2 -- it should hopefully fix these issues. Thanks again for being persistent on this one!

@20chan
Copy link
Author

20chan commented Aug 30, 2017

I'm sorry, it's much better but it still have issue. Three dots character makes line little bit longer.
screenshot

@eamodio
Copy link
Member

eamodio commented Aug 30, 2017

@Phillyai what font is that? (Also is that file in the repo?)

This is what I see with Inconsolata (in the lexer.py file)
image

@20chan
Copy link
Author

20chan commented Aug 30, 2017

I'm using Inconsolata, same as you, and sorry, this is another repository.
Also I tried lexer.py in bumble, and it is working very well.

@eamodio
Copy link
Member

eamodio commented Aug 30, 2017

OK -- I'll check that one out -- thank you!

@eamodio eamodio reopened this Aug 30, 2017
@eamodio eamodio added the bug Something isn't working label Oct 3, 2017
@github-actions
Copy link

github-actions bot commented Dec 7, 2020

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants