Commit e51dbf8
authored
highlighter: prevent empty range style leaks (#2457)
## Summary
- Ignore empty syntax highlight ranges before style merging
- Filter empty ranges in `unique_styles` so zero-length captures cannot
remain active after their position
- Add a focused regression case covering empty ranges leaking styles
into later spans
## Screenshots
### Before
<img width="1918" height="1078" alt="before"
src="https://github.com/user-attachments/assets/284d4a15-e044-4bd3-98c6-2fdf4ea47da3"
/>
### After
<img width="1918" height="1078" alt="after"
src="https://github.com/user-attachments/assets/b07d2021-da2e-4efb-b3ce-90b697203894"
/>1 parent 4504e48 commit e51dbf8
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
921 | 921 | | |
922 | 922 | | |
923 | 923 | | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
924 | 927 | | |
925 | 928 | | |
926 | 929 | | |
| |||
960 | 963 | | |
961 | 964 | | |
962 | 965 | | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
963 | 971 | | |
964 | 972 | | |
965 | 973 | | |
| |||
1392 | 1400 | | |
1393 | 1401 | | |
1394 | 1402 | | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
1395 | 1409 | | |
1396 | 1410 | | |
0 commit comments