lsd-rs / lsd

The next gen ls command
Apache License 2.0
12.8k stars 413 forks source link

Fixed misaligned outputs and unicode-width dependency version #1064

Open ehwan opened 2 weeks ago

ehwan commented 2 weeks ago

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

muniu-bot[bot] commented 2 weeks ago

[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: - **[OWNERS](https://github.com/lsd-rs/lsd/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
zwpaper commented 2 weeks ago

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

ehwan commented 2 weeks ago

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.