-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle %s strings with length and alignment
%s format strings allow for padding and alignment, but their behaviour is very different from fstrings. %20s will pad a string to 20 characters, and right align %-20s will pad a string to 20 characters, and left align This behaviour is carried over from the C *printf() functions. This patch adds the ability to properly convert these to fstrings, using the correct alignment markers. The feature is gated behind aggressive mode for now. The earlier code did already convert %20s, but changed the alignment (the resulting fstring would be left aligned instead of right), and did not understand %-20s at all.
- Loading branch information
Ralf Ertzinger
committed
Nov 16, 2023
1 parent
651c822
commit 4acbc3d
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters