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

Table misalignment #135

Open
Silent-Hunter opened this issue Feb 12, 2019 · 9 comments
Open

Table misalignment #135

Silent-Hunter opened this issue Feb 12, 2019 · 9 comments

Comments

@Silent-Hunter
Copy link
Contributor

I think maybe my pull request introduced an issue. The wind speed line is misaligned on all terminals now. The weird thing is, it was working earlier just fine, and now it's suddenly broken. I didn't change anything, so I'm not sure what's going on. I tried it in urxvt, xterm, and xfce4-terminal.

What it looked like before my changes:
photo_2019-02-11_16-46-19

What it looked like after (but before my pull request, this screenshot is from my changes before uploading them):
photo_2019-02-11_17-10-09

And now it looks like this:
xscreenshot

@schachmat
Copy link
Owner

Did you change your font or terminal setup? Iirc the arrow in the wind line is an "east asian ambiguous width" character which can take up one or two spaces. This depends on font and terminal setup.

@Silent-Hunter
Copy link
Contributor Author

No I didn't. That's the weird thing, it just changed at some point. Oddly enough, I checked my desktop and it's changed there too, even though I hadn't booted into Linux in two weeks on that. And it was the old version of wego on there. I can't begin to imagine what's happened. I assume it's still working correctly for you after the changes?

Also dropping out of X11 and running wego from the console has the same issue.

@Silent-Hunter
Copy link
Contributor Author

Oops. Uhhh, wrong button sorry.

@Silent-Hunter Silent-Hunter reopened this Feb 12, 2019
@schachmat
Copy link
Owner

I can confirm the same issue happens to me as well both before and after your temperature patch.

I haven't used wego in a while and currently don't have the time to debug this, but here are some pointers:

https://github.com/mattn/go-runewidth is used to compute the real width of strings and it is used here: https://github.com/schachmat/wego/blob/master/frontends/ascii-art-table.go#L31

Maybe the implementation of runewidth changed over the last two years and now it's behaving differently… I should have vendored away the dependencies back when it was working… :/

@Silent-Hunter
Copy link
Contributor Author

Hmm... But it's strange because it was working even after my patch, and only broke later. Another solutuon could be to have an option in the config to use letters for wind direction, like N, NW, etc.

I wasn't aware you didn't use this program anymore. I'll have a look at runewidth and see if I can fix it, but I'm not really a programmer.

@Silent-Hunter
Copy link
Contributor Author

Hey, what do you think of the arrows being letter directions, like N, NW, etc.? The arrows are kinda hard to see on all the terminals I've tried so far anyway. And I tried changing it to letters and it seems a bit more easy to read. I don't know how to make it a config file option but that might be a good idea.

@biotinker
Copy link

biotinker commented May 24, 2019

Just submitted a PR fixing this. If we select a diagonal arrow, we need to increase the padding by 1.

Personally I prefer the arrows to letter directions

@luisleee
Copy link

luisleee commented Jun 6, 2020

2020-06-06 20-15-43屏幕截图
I find that the lines with and are wrong too.

@luisleee
Copy link

luisleee commented Jun 6, 2020

Is that related to that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants