Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for access to Formatter alignment #27726
Comments
alexcrichton
added
T-libs
B-unstable
labels
Aug 12, 2015
This comment has been minimized.
This comment has been minimized.
Yes, please.
Why? Makes little sense. |
This comment has been minimized.
This comment has been minimized.
|
I disagree that it makes little sense to expose getters, it's possible to envision a situation where one formatting is composed of many others and you perhaps want some to be formatted to various widths or perhaps enable various flags (e.g. the "alternate" mode). It's certainly niche but it's somewhat necessary for completeness. |
This comment has been minimized.
This comment has been minimized.
|
I would also very much like to add and stabilize boolean accessors for the various parts of I'm a little less sure about |
This comment has been minimized.
This comment has been minimized.
|
I'd be fine just deprecating the I'd also be fine making |
alexcrichton
added
the
I-nominated
label
Sep 17, 2015
sfackler
added a commit
to sfackler/rust
that referenced
this issue
Sep 24, 2015
This comment has been minimized.
This comment has been minimized.
|
This issue is now entering its cycle-long FCP for stabilization in 1.5 The accessors being added in #28615 will also be considered for stabilization. |
alexcrichton
added
final-comment-period
and removed
I-nominated
labels
Sep 24, 2015
This comment has been minimized.
This comment has been minimized.
|
Ah, and @SimonSapin, may be good to get your opinion on the grapheme-vs- |
This comment has been minimized.
This comment has been minimized.
|
Uh. It’s not just graphemes. The whole
Unfortunately, as often with Unicode, it’s complicated. Not only grapheme clusters can have more than one code point and still only use one slot (with combining code points), but most characters of some Asian languages and most emoji are “full width”: they’re twice the usual width in most monospace fonts. Control characters might or might not be displayed. Or they might be interpreted by the terminal to move the cursor around. http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/#combining-characters-and-character-width has some more background. Here is an extract, about emoji flags:
Our best bet for ”what is the width of this string?” is probably https://github.com/unicode-rs/unicode-width That leaves dealing with |
This comment has been minimized.
This comment has been minimized.
|
Hm, those are very good points! I would be mostly tempted to just pare down everything and say it largely deals with ascii only (and maybe simple unicode?). I don't think it'd be too beneficial to start getting full-blown unicode-width support in libcore just to support a use case like this. Having some verification in the compiler, however, to make sure you're not doing crazy things seems reasonable?
In theory, yes.
I'd also be fine with this! |
bors
added a commit
that referenced
this issue
Sep 26, 2015
steveklabnik
added this to the 1.5 milestone
Oct 1, 2015
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this during triage today and the decision was to stabilize. |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Oct 23, 2015
bors
added a commit
that referenced
this issue
Oct 24, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Oct 24, 2015
bors
added a commit
that referenced
this issue
Oct 25, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Oct 25, 2015
bors
added a commit
that referenced
this issue
Oct 25, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Oct 25, 2015
bors
added a commit
that referenced
this issue
Oct 25, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Oct 25, 2015
bors
added a commit
that referenced
this issue
Oct 25, 2015
arcnmx
added a commit
to arcnmx/rust
that referenced
this issue
Nov 2, 2015
This comment has been minimized.
This comment has been minimized.
|
|
mbrubeck
reopened this
Mar 31, 2017
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
|
I am a bit confused about the reason Is there anything I can help with to move this along? |
This comment has been minimized.
This comment has been minimized.
|
@rust-lang/libs Nominating for stabilization. I suspect that src/libfmt_macros/lib.rs
86:pub enum Alignment {
87- /// The value will be aligned to the left.
88- AlignLeft,
89- /// The value will be aligned to the right.
90- AlignRight,
91- /// The value will be aligned in the center.
92- AlignCenter,
93- /// The value will take on a default alignment.
94- AlignUnknown,
95-}
src/libcore/fmt/mod.rs
31:pub enum Alignment {
32- /// Indication that contents should be left-aligned.
33- Left,
34- /// Indication that contents should be right-aligned.
35- Right,
36- /// Indication that contents should be center-aligned.
37- Center,
38- /// No alignment was requested.
39- Unknown,
40-}
src/libcore/fmt/rt/v1.rs
35:pub enum Alignment {
36- /// Indication that contents should be left-aligned.
37- Left,
38- /// Indication that contents should be right-aligned.
39- Right,
40- /// Indication that contents should be center-aligned.
41- Center,
42- /// No alignment was requested.
43- Unknown,
44-} |
Mark-Simulacrum
added
the
I-nominated
label
Jan 15, 2018
Mark-Simulacrum
removed this from the 1.5 milestone
Jan 15, 2018
Mark-Simulacrum
changed the title
Tracking issue for access to Formatter flags/options
Tracking issue for access to Formatter fmt_align
Jan 15, 2018
Mark-Simulacrum
changed the title
Tracking issue for access to Formatter fmt_align
Tracking issue for access to Formatter alignment
Jan 15, 2018
This comment has been minimized.
This comment has been minimized.
|
I think we should remove @rfcbot fcp merge |
rfcbot
added
the
proposed-final-comment-period
label
Jan 23, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Jan 23, 2018
•
|
Team member @sfackler has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
alexcrichton
removed
the
I-nominated
label
Jan 29, 2018
rfcbot
added
the
final-comment-period
label
Feb 14, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Feb 14, 2018
|
|
1 similar comment
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Feb 14, 2018
|
|
rfcbot
added
final-comment-period
and removed
proposed-final-comment-period
labels
Feb 14, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Feb 24, 2018
|
The final comment period is now complete. |
tmccombs
added a commit
to tmccombs/rust
that referenced
this issue
Apr 10, 2018
tmccombs
added a commit
to tmccombs/rust
that referenced
this issue
Apr 30, 2018
This comment has been minimized.
This comment has been minimized.
|
Shouldn't this get merged then? |
This comment has been minimized.
This comment has been minimized.
|
Yes, with FCP to stabilize completed, the next step is a stabilization PR. |
alexcrichton commentedAug 12, 2015
•
edited by Mark-Simulacrum
Tracking issue for the
fmt_flags_alignfeature, which isfmt::Formatter::alignand the associated enum.