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

🐛 truncate_str does not truncate to exact width #1144

Closed
SheldonNico opened this issue Aug 2, 2022 · 0 comments
Closed

🐛 truncate_str does not truncate to exact width #1144

SheldonNico opened this issue Aug 2, 2022 · 0 comments

Comments

@SheldonNico
Copy link
Contributor

  • [x ] Please include the raw text output from git, so that we can reproduce the problem.
    (You can use git --no-pager to produce the raw text output.)
diff --git a/bad_width_a.txt b/bad_width_b.txt
index 8b0d958..e69de29 100644
--- a/bad_width_a.txt
+++ b/bad_width_b.txt
@@ -1,5 +0,0 @@
-中文字符长度通常为2
-
-中文字符长度通x常为2
-
-abcdefghijklm j
  • [ x] A screenshot of Delta's output is often helpful also.
    image

ansi::truncate_str does not truncate str to exact width and cause bad alignment

SheldonNico added a commit to SheldonNico/delta that referenced this issue Aug 2, 2022
SheldonNico added a commit to SheldonNico/delta that referenced this issue Oct 21, 2022
dandavison pushed a commit that referenced this issue Dec 3, 2022
* try fix bad alignment in unicode (#1144)

* use width instead of count in wrap_line

* fix fmt

* 3 tests do not need fail

* fix tests

Co-authored-by: Thomas Otto <th1000s@posteo.net>
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

1 participant