Commit 3c9a21c
fix: use correct cursor scroll position for wide (CJK) characters (#10)
Use unicode display width instead of char count when computing the
horizontal scroll offset so the cursor stays in view when lines contain
wide characters such as CJK ideographs.
Ported from rhysd/tui-textarea#94.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a91e715 commit 3c9a21c
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
115 | 122 | | |
116 | 123 | | |
117 | 124 | | |
| |||
0 commit comments