Skip to content
Myr

Merge pull request #2058 from jap/improve-copy-paste

Before adoption: this commit came in with the history the project adopted, so no landing records it.

fix overline and italic styles

authored by David Lord · committed by GitHub · parents 01e4dac, cf3b138 · Browse files · 3 files+14 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+14 added−4 removed

  • tests:+10 added−2 removed
  • other:+4 added−2 removed

3 files+14 added−4 removed

modified:src/click/termui.py+2 added-2 removed
594 unmodified lines
595 bits.append(f"\033[{2 if dim else 22}m")596 if underline is not None:597 bits.append(f"\033[{4 if underline else 24}m")598 if overline is not None:599 bits.append(f"\033[{53 if underline else 55}m")599 bits.append(f"\033[{53 if overline else 55}m")600 if italic is not None:601 bits.append(f"\033[{5 if underline else 23}m")601 bits.append(f"\033[{3 if italic else 23}m")602 if blink is not None:603 bits.append(f"\033[{5 if blink else 25}m")604 if reverse is not None:605 bits.append(f"\033[{7 if reverse else 27}m")
202 unmodified lines
modified:tests/test_utils.py+10 added-2 removed
65 unmodified lines
66 ({"bg": (135, 0, 175)}, "\x1b[48;2;135;0;175mx y\x1b[0m"),67 ({"bold": True}, "\x1b[1mx y\x1b[0m"),68 ({"dim": True}, "\x1b[2mx y\x1b[0m"),69 ({"underline": True}, "\x1b[4mx y\x1b[0m"),70 ({"overline": True}, "\x1b[55mx y\x1b[0m"),71 ({"italic": True}, "\x1b[23mx y\x1b[0m"),70 ({"overline": True}, "\x1b[53mx y\x1b[0m"),71 ({"italic": True}, "\x1b[3mx y\x1b[0m"),72 ({"blink": True}, "\x1b[5mx y\x1b[0m"),73 ({"reverse": True}, "\x1b[7mx y\x1b[0m"),74 ({"strikethrough": True}, "\x1b[9mx y\x1b[0m"),75 ({"bold": False}, "\x1b[22mx y\x1b[0m"),76 ({"dim": False}, "\x1b[22mx y\x1b[0m"),77 ({"underline": False}, "\x1b[24mx y\x1b[0m"),78 ({"overline": False}, "\x1b[55mx y\x1b[0m"),79 ({"italic": False}, "\x1b[23mx y\x1b[0m"),80 ({"blink": False}, "\x1b[25mx y\x1b[0m"),81 ({"reverse": False}, "\x1b[27mx y\x1b[0m"),82 ({"strikethrough": False}, "\x1b[29mx y\x1b[0m"),83 ({"fg": "black", "reset": False}, "\x1b[30mx y"),84 ],85)86def test_styling(styles, ref):
404 unmodified lines
modified:CHANGES.rst+2 added
16 unmodified lines
17- Completion does not skip Python's resource cleanup when exiting,18 avoiding some unexpected warning output. :issue:`1738, 2017`19- Fix type annotation for ``type`` argument in ``prompt`` function.20 :issue:`2062`21- Fix overline and italic styles, which were incorrectly added when22 adding underline. :pr:`2058`232425Version 8.0.126-------------
889 unmodified lines