-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Show tabs in pre elements #5470
Conversation
@@ -521,6 +521,9 @@ impl Shaper { | |||
// We elect to only space the two required code points. | |||
if character == ' ' || character == '\u{a0}' { | |||
advance = advance + options.word_spacing | |||
} else if character == '\u{9}' || character == '\t' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'\u{9}'
and '\t'
are the same value, so this is redundant.
Pretty sure tabs should be 8 spaces. |
Firefox uses 8 spaces per tab stop, and a tab advances to the next tab stop. (So in "AAA\tB" the tab only advances five spaces, because it starts at column three.) But that could be saved for a follow-up bug... |
@mbrubeck sry, I wasn't thinking there. |
@mbrubeck I looked at the gecko code (which does that) & decided I didn't want to try & implement the whole thing in one go. Also I'm not sure if their implementation is how I'd want to do it. |
Critic review: https://critic.hoppipolla.co.uk/r/4460 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
Assigned @mbrubeck since he seems to be doing the review. |
Looks great, thanks! I put one minor issue on Critic, but this can land with r=mbrubeck as soon as that's addressed. |
@mbrubeck I removed the f64 cast, thnx for the catch. |
Thanks! r=mbrubeck, needs squash. |
Display tab characters as 8 spaces for pre and other elements that don't compress whitespace.
@mbrubeck Thanks! squashed |
Bors appears to be stuck; closing temporarily. |
Display tab characters as 4 spaces for pre and other elements that don't
compress whitespace.
Fixes #4651
@pcwalton r?