Skip to content

Cannot show a long line of CJK charactors (e.g. Chinese) completely #24175

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

Open
Hammerklavier-cn opened this issue Feb 4, 2025 · 2 comments
Open

Comments

@Hammerklavier-cn
Copy link

Hammerklavier-cn commented Feb 4, 2025

Summary

Steps to trigger the problem:

  1. Type a long line of Chinese characters in a markdown file until exceeding the width of the window

    The content is as followed:

肿瘤的扩散

扩散方式 定义 途径
直接蔓延 1. 组织间隙
2. 淋巴管
3. 血管
4. 神经束衣
转移 恶性肿瘤细胞从原发部位侵入淋巴管、血管或体腔,不连续地迁徙到他处而继续生长,形成与原发瘤同样类型的肿瘤 1. 淋巴道转移:上皮起源的恶性肿瘤
2. 血道转移:间叶组织起源的恶性肿瘤;肝细胞癌,肾细胞癌;大部分癌的晚期
3. 种植性转移:恶性肿瘤侵犯器官表面时,瘤细胞脱落,并种植在体腔内器官的表面。见于原发于腹腔的恶性肿瘤。

Copy pastable code for above:

## 肿瘤的扩散

| 扩散方式 | 定义                                                  | 途径                                                                                                                             |
| ---- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| 直接蔓延 |                                                     | 1. 组织间隙<br/>2. 淋巴管<br/>3. 血管<br/>4. 神经束衣                                                                                       |
| 转移   | 恶性肿瘤细胞从原发部位侵入淋巴管、血管或体腔,不连续地迁徙到他处而继续生长,形成与原发瘤同样类型的肿瘤 | 1. **淋巴道转移**:上皮起源的恶性肿瘤<br/>2. **血道转移**:间叶组织起源的恶性肿瘤;肝细胞癌,肾细胞癌;大部分癌的晚期<br/>3. 种植性转移:恶性肿瘤侵犯器官表面时,瘤细胞脱落,并种植在体腔内器官的表面。见于原发于腹腔的恶性肿瘤。 |

Actual Behavior:
The end of the line cannot be seen. There is still hidden characters of the third line of the table.

Image

Expected Behavior:
Drag the vertical scrollbar, and the end of the line should be seen.

Zed Version and System Specs

Zed: v0.172.5 (Zed Preview)
OS: Linux Wayland ubuntu 17
Memory: 30.9 GiB
Architecture: x86_64
GPU: AMD Radeon RX 7700 XT || AMD open-source driver || 2024.Q1.2 (LLPC)

@rien7
Copy link
Contributor

rien7 commented Feb 8, 2025

provide a smaller case:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试

the number of characters is not important, just need to match this rule:

  1. the first line ('x' line) should be long enough. (exceeding the boundary, causing a horizontal scrollbar to appear)
  2. the second line should long enough. (exceeding the boundary)
  3. the number of characters in the second line should be smaller than (or equal to) the first line. (in the example, each line has 40 characters)

And I find out that snapshot.longest_row() returns the first line because each line has the same character count. However, since Chinese characters have a wider character width than English characters, the same number of characters will appear visually longer in Chinese, causing them to exceed the boundary and become unreadable.

I want to dive deeper into this issue, but once inside snapshot, the problem goes beyond my ability. I hope someone can either fix this issue or guide me on how to investigate it further.

@JunkuiZhang
Copy link
Contributor

Interesting, I will look into this tomorrow

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

3 participants