From e3fd467b44d80092cbeac13a64c41155f8240097 Mon Sep 17 00:00:00 2001 From: TheLizzard Date: Sun, 19 Oct 2025 18:19:56 +0100 Subject: [PATCH 1/3] fix syntax highlighting when line ends in slash --- Lib/idlelib/colorizer.py | 31 +++++++++++++++++++++++-- Lib/idlelib/idle_test/test_colorizer.py | 13 ++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/Lib/idlelib/colorizer.py b/Lib/idlelib/colorizer.py index bffa2ddd3cd9cd..899584554061ce 100644 --- a/Lib/idlelib/colorizer.py +++ b/Lib/idlelib/colorizer.py @@ -17,6 +17,7 @@ def any(name, alternates): def make_pat(): kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b" match_softkw = ( + r"(?match)\b" + r"(?![ \t]*(?:" + "|".join([ # not followed by ... @@ -27,11 +28,13 @@ def make_pat(): r"))" ) case_default = ( + r"(?case)" + r"[ \t]+(?P_\b)" ) case_softkw_and_pattern = ( + r"(?case)\b" + r"(?![ \t]*(?:" + "|".join([ # not followed by ... @@ -45,7 +48,30 @@ def make_pat(): builtinlist = [str(name) for name in dir(builtins) if not name.startswith('_') and name not in keyword.kwlist] - builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b" + builtin = ( + r"(? Date: Sun, 19 Oct 2025 18:51:42 +0100 Subject: [PATCH 2/3] added name in ACKS and added blurb --- Misc/ACKS | 1 + .../next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst diff --git a/Misc/ACKS b/Misc/ACKS index 2dc513829a2218..465866444a93ee 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1942,6 +1942,7 @@ John Tromp Diane Trout Jason Trowbridge Steven Troxler +Daniel Tsvetkov Brent Tubbs Anthony Tuininga Erno Tukia diff --git a/Misc/NEWS.d/next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst b/Misc/NEWS.d/next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst new file mode 100644 index 00000000000000..5e64da1c6ccb69 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst @@ -0,0 +1,2 @@ +Fixed syntax highlighting in IDLE where slashes at the end of lines aren't +treated as line continuations From 5efc4bc1620f0ae62bf1d6bdafda70173c5250f5 Mon Sep 17 00:00:00 2001 From: TheLizzard Date: Sun, 19 Oct 2025 19:31:02 +0100 Subject: [PATCH 3/3] Update Misc/NEWS.d/next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst Made by @StanFromIreland Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- .../next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst b/Misc/NEWS.d/next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst index 5e64da1c6ccb69..b268b850e2258c 100644 --- a/Misc/NEWS.d/next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst +++ b/Misc/NEWS.d/next/IDLE/2025-10-19-18-43-07.gh-issue-140334.3mdyHm.rst @@ -1,2 +1,2 @@ -Fixed syntax highlighting in IDLE where slashes at the end of lines aren't -treated as line continuations +Fixed syntax highlighting in :mod:`IDLE ` where slashes at the end of lines aren't +treated as line continuations.