Skip to content

fix: correctly count tabs for last patch line#380

Merged
epage merged 6 commits intorust-lang:mainfrom
Muscraft:fix-patch-tabs-last-line
Mar 4, 2026
Merged

fix: correctly count tabs for last patch line#380
epage merged 6 commits intorust-lang:mainfrom
Muscraft:fix-patch-tabs-last-line

Conversation

@Muscraft
Copy link
Copy Markdown
Member

@Muscraft Muscraft commented Mar 4, 2026

While reviewing #373, I realized that we were calculating the extra tab width for a line using span_start.char, regardless of the line we were on. In very specific cases, this could cause the highlighting of the last line to be wrong.

Note: While working on the fix, I realized there was a lot of duplicate logic that could be merged to simplify the overall logic and make it easier to understand what is happening.

@epage epage merged commit e98ff09 into rust-lang:main Mar 4, 2026
15 of 16 checks passed
@Muscraft Muscraft deleted the fix-patch-tabs-last-line branch March 4, 2026 16:03
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

Successfully merging this pull request may close these issues.

2 participants