Skip to content

Commit 4c4da42

Browse files
Vosjedevsebastinas
authored andcommitted
Add italic support
1 parent 4c898d7 commit 4c4da42

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

curtsies/fmtfuncs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
bold = _partial(fmtstr, style="bold")
2424
dark = _partial(fmtstr, style="dark")
25+
italic = _partial(fmtstr, style="italic")
2526
underline = _partial(fmtstr, style="underline")
2627
blink = _partial(fmtstr, style="blink")
2728
invert = _partial(fmtstr, style="invert")

curtsies/formatstring.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
one_arg_xforms: Mapping[str, Callable[[str], str]] = {
6060
"bold": lambda s: seq(STYLES["bold"]) + s + seq(RESET_ALL),
6161
"dark": lambda s: seq(STYLES["dark"]) + s + seq(RESET_ALL),
62+
"italic": lambda s: seq(STYLES["italic"]) + s + seq(RESET_ALL),
6263
"underline": lambda s: seq(STYLES["underline"]) + s + seq(RESET_ALL),
6364
"blink": lambda s: seq(STYLES["blink"]) + s + seq(RESET_ALL),
6465
"invert": lambda s: seq(STYLES["invert"]) + s + seq(RESET_ALL),

curtsies/termformatconstants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
FG_COLORS: Mapping[str, int] = dict(zip(colors, range(30, 38)))
77
BG_COLORS: Mapping[str, int] = dict(zip(colors, range(40, 48)))
88
STYLES: Mapping[str, int] = dict(
9-
zip(("bold", "dark", "underline", "blink", "invert"), (1, 2, 4, 5, 7))
9+
zip(("bold", "dark", "italic", "underline", "blink", "invert"), (1, 2, 3, 4, 5, 7))
1010
)
1111
FG_NUMBER_TO_COLOR: Mapping[int, str] = dict(zip(FG_COLORS.values(), FG_COLORS.keys()))
1212
BG_NUMBER_TO_COLOR: Mapping[int, str] = dict(zip(BG_COLORS.values(), BG_COLORS.keys()))

0 commit comments

Comments
 (0)