Closed erhhung closed 3 months ago
I vaguely remember a similar issue, either from myself or by another user on the issue tracker. But I can't reproduce this locally on master so it seems to be a platform/font/terminal issue.
Likely cause by macos wcswidth
returning 2 width for some icons: https://github.com/jarun/nnn/issues/1692#issuecomment-1637153406
Thanks. I suppose updating the namefirst patch to use the added macro might fix this then.
EDIT: hmm the macro we added doesn't seem to apply to where the issue shows up in the name first patch. Only thing I can think of to work around this would be to hardcode the wcswidth for the offending icons. I won't be doing that... (Is the upstream library aware of this issue and is there any chance it will be fixed?)
Only thing I can think of to work around this would be to hardcode the wcswidth for the offending icons.
There was also this patch (https://github.com/jarun/nnn/pull/1694) which fixed the issue by clearing the whole screen IIRC. It "worked" but had pretty bad performance impact though. Maybe this gives you some ideas.
Added to Tracker. Closing here.
Since day 1 there have been problems with alignment with icons. This is an old issue and seems deeply connected to the way terminals render characters. In all this time no one has been able to either solve the issue universally or provide proof that it can't be done. We'll just leave it there in case someone want to give it another shot.
Environment details (Put
x
in the checkbox along with the information)NNN_OPTS=acdeoEHQR
NNN_PLUG=v:-preview-tui;y:-cbcopy-mac
nnn
masterExact steps to reproduce the issue
Create a build with Nerd Fonts and name first options enabled:
make clean; make O_NERD=1 O_NAMEFIRST=1; ./nnn
Press
d
to hide the detail columns:Notice that the file size column has not been properly cleared.
If, instead, build without either above options, columns are aligned:
make clean; make O_NERD=1; ./nnn
make clean; make O_NAMEFIRST=1; ./nnn
Other observations