gongo / 9t

9t is multi-file tailer by golang
133 stars 16 forks source link

Filename width fix #5

Closed NHOrus closed 7 years ago

NHOrus commented 7 years ago

Some people have unicode filenames. They obviously misalign with naive width calculations.

NHOrus commented 7 years ago

And I am done for today.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 70.69% when pulling ef875337280aff63bebac2d0aaf901f06f921a1e on NHOrus:namewidth into 2abe4bb994e2499a06b432b5a440b99679079d39 on gongo:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 70.69% when pulling ef875337280aff63bebac2d0aaf901f06f921a1e on NHOrus:namewidth into 2abe4bb994e2499a06b432b5a440b99679079d39 on gongo:master.

gongo commented 7 years ago

In my environment:

image

NHOrus commented 7 years ago

screenshot at 2017-02-04 03-22-01 Without filename width patch and with it. Need to think more about it.

NHOrus commented 7 years ago

screenshot at 2017-02-04 03-27-01 And with utf8. RuneCountInString() instead of go-runewidth.

NHOrus commented 7 years ago

Sorry. I don't know.

gongo commented 7 years ago

I will try to check that out too 💪

gongo commented 7 years ago

Hi @NHOrus . I came up with a good way. I might develop it on another branch. 🙏

NHOrus commented 7 years ago

I think if you succeed it would be great to put in it's own library. Because, well, not a question of width of symbol, but width of a glyph in font.

Also, willing to help with that.

gongo commented 7 years ago

Because, well, not a question of width of symbol, but width of a glyph in font.

Sure.

But, even if it can not be solved in all environments , it may be able to solve to some extent (for example: limited to monospaced fonts) 💪

emersion commented 7 years ago

Maybe this can help? https://godoc.org/golang.org/x/text/width

gongo commented 7 years ago

@NHOrus

I fixed it in GH-7, so close this PR. Thanks !!