Commit f844a68
authored
fix(chat): correct header highlighting for multi-byte characters (#1385)
The previous implementation used vim.fn.strwidth() to calculate the end column for header highlighting. This function returns the display width, which can differ from the byte length when multi-byte characters like emojis are present.
Since the end_col for extmarks expects a byte-based index, this caused the highlighting to be applied incorrectly.
This patch corrects the issue by using the byte length (#header_value) for the end_col of the highlight extmark, while still using vim.fn.strwidth() for virt_text_win_col to ensure correct visual alignment of UI elements.
Fixes #13841 parent a657694 commit f844a68
1 file changed
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
623 | | - | |
624 | | - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
625 | 631 | | |
626 | 632 | | |
627 | 633 | | |
628 | | - | |
| 634 | + | |
629 | 635 | | |
630 | 636 | | |
631 | 637 | | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| |||
0 commit comments