wego icon indicating copy to clipboard operation
wego copied to clipboard

Table misalignment

Open Silent-Hunter opened this issue 6 years ago • 9 comments

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

Silent-Hunter avatar Feb 12 '19 03:02 Silent-Hunter

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.

schachmat avatar Feb 12 '19 13:02 schachmat

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 avatar Feb 12 '19 15:02 Silent-Hunter

Oops. Uhhh, wrong button sorry.

Silent-Hunter avatar Feb 12 '19 15:02 Silent-Hunter

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… :/

schachmat avatar Feb 12 '19 16:02 schachmat

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 avatar Feb 12 '19 17:02 Silent-Hunter

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.

Silent-Hunter avatar Mar 02 '19 22:03 Silent-Hunter

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

biotinker avatar May 24 '19 04:05 biotinker

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

luisleee avatar Jun 06 '20 12:06 luisleee

Is that related to that?

luisleee avatar Jun 06 '20 12:06 luisleee