lsd icon indicating copy to clipboard operation
lsd copied to clipboard

Fixed misaligned outputs and unicode-width dependency version

Open ehwan opened this issue 1 year ago • 3 comments

This could possibly fix misaligned output issues #1063

The problem occured only if when I cargo install lsd, not when I build it directly from the clone or install it via brew.

This is because of the dependency unicode-width's version. The version installed via cargo install was using the latest unicode-width, v0.1.13, but others were using v0.1.11 because of Cargo.lock.

The dependency unicode-width had a breaking change between v0.1.11 and v0.1.13 that returns a different result when counting unicode characters.

The new behavior in unicode-width v0.1.13 is more intuitive for calculating the length of a unicode string, so I fixed the logic accordingly.


TODO

  • [x] Use cargo fmt
  • [x] Add necessary tests
  • [x] Update default config/theme in README (if applicable)
  • [x] Update man page at lsd/doc/lsd.md (if applicable)

ehwan avatar Jun 18 '24 16:06 ehwan

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ehwan Once this PR has been reviewed and has the lgtm label, please assign zwpaper for approval by writing /assign @zwpaper in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

muniu-bot[bot] avatar Jun 18 '24 16:06 muniu-bot[bot]

hi @ehwan, thanks so much for fixing the issue, but it seems not to be helping https://github.com/lsd-rs/lsd/issues/1054, can you add some tests so that we can make sure it works?

I cloned your code and change one of my icon to unicode:

CleanShot 2024-06-22 at 11 49 22@2x

zwpaper avatar Jun 22 '24 03:06 zwpaper

Hi @zwpaper, and thank you for reviewing.

I apologize that I misunderstood the term 'misaligned' in #1054. This PR does not fix the issue. I've deleted the mention in the description.

ehwan avatar Jun 22 '24 04:06 ehwan

This fix worked for me, running Debian on an rPi5.

hucklesberries avatar Jul 09 '24 22:07 hucklesberries

sorry for the late review, I have tested it and made sure it was really caused by the dependency break.

https://github.com/unicode-rs/unicode-width/issues/55

let's merge this and create a release for it!

zwpaper avatar Aug 20 '24 15:08 zwpaper

thanks so much for the help @ehwan

zwpaper avatar Aug 20 '24 15:08 zwpaper