From 8453a79bcd440ca77505537b7798e382eeb2d2bb Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 26 Sep 2026 11:37:42 +0000 Subject: [PATCH 1/3] Test match/case and forward references; correct CI versions Both were listed as features without assertions. The README said CI runs Vim 9.2 on Linux; ubuntu-latest installs Ubuntu's Vim 9.1. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NHGQAYx5m3Fs5HUYPdtUWt --- README.md | 6 +++--- tests/test_syntax.vim | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 68f2295..134f586 100644 --- a/README.md +++ b/README.md @@ -77,9 +77,9 @@ Run `:helptags ALL` once afterwards to enable `:help python-syntax-enhanced`. ### Compatibility -Tested in CI on Vim 9.2 (Linux, macOS, Windows) and Neovim 0.12, and locally -with Vim 9.1. It replaces Vim's built-in `syntax/python.vim`, so disable other -Python syntax plugins (see [Troubleshooting](#troubleshooting)). +Tested in CI on Vim 9.1 (Linux), Vim 9.2 (macOS, Windows) and Neovim 0.12. +It replaces Vim's built-in `syntax/python.vim`, so disable other Python syntax +plugins (see [Troubleshooting](#troubleshooting)). In Neovim this is a regular syntax file: it applies when Python is highlighted by the syntax engine (Neovim's default). If Tree-sitter highlighting is enabled diff --git a/tests/test_syntax.vim b/tests/test_syntax.vim index 05f2330..1bb2333 100644 --- a/tests/test_syntax.vim +++ b/tests/test_syntax.vim @@ -157,6 +157,12 @@ call setline(1, [ \ ' pass', \ 'n = 1 # type: int', \ 'o = f() # type: ignore[attr-defined]', + \ 'match command:', + \ ' case Point(x=0):', + \ ' pass', + \ 'match = re.match(p, s)', + \ 'def fwd(u: "User") -> "list[User]": ...', + \ 'case = 1', \ ]) setlocal filetype=python syntax sync fromstart @@ -283,6 +289,16 @@ call s:AssertGroup(105, s:ColOf(105, 'type'), 'pythonComment', '# type: prefix') call s:AssertGroup(105, s:ColOf(105, 'int'), 'pythonPrimitiveType', '# type: int') call s:AssertGroup(106, s:ColOf(106, 'ignore'), 'pythonComment', '# type: ignore') +" match/case are keywords only as statements (soft keywords) +call s:AssertGroup(107, s:ColOf(107, 'match'), 'pythonConditional', 'match statement') +call s:AssertGroup(108, s:ColOf(108, 'case'), 'pythonConditional', 'case clause') +call s:AssertNotGroup(110, s:ColOf(110, 'match'), 'pythonConditional', 'match as a variable') +call s:AssertNotGroup(112, s:ColOf(112, 'case'), 'pythonConditional', 'case as a variable') + +" Quoted forward references in annotations +call s:AssertGroup(111, s:ColOf(111, '"User"'), 'pythonTypeString', 'forward ref param') +call s:AssertGroup(111, s:ColOf(111, '"list'), 'pythonTypeString', 'forward ref return') + " Palette: builtins get their own color, not the Function link call s:AssertGroup(4, s:ColOf(4, 'list'), 'pythonBuiltin', 'list() call for palette check') if synIDattr(synIDtrans(hlID('pythonBuiltin')), 'fg', 'cterm') !=# '139' From 0b9b1dad83ecce8ba3c11394a1096fa693886215 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle <32690992+aaronbcarlisle@users.noreply.github.com> Date: Sat, 26 Sep 2026 07:46:00 -0400 Subject: [PATCH 2/3] Replace before and after image in README Updated the image in the README to show the new before and after comparison. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 134f586..39b70bb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +before_after # Python Syntax Enhanced [![Tests](https://github.com/aaronbcarlisle/python-syntax-enhanced/actions/workflows/test.yml/badge.svg)](https://github.com/aaronbcarlisle/python-syntax-enhanced/actions/workflows/test.yml) @@ -11,7 +12,7 @@ one that colors types only where they are types: parameter and return annotations, `x: T` and `self.attr: T`, class bases, and PEP 695 type parameters and `type` aliases. -![Before and after: Vim's built-in Python syntax next to python-syntax-enhanced, colorscheme retrobox](https://github.com/user-attachments/assets/e3f130c2-17f7-454b-95ce-0d3ebe375438) +![Before and after: Vim's built-in Python syntax next to python-syntax-enhanced, colorscheme retrobox](https://github.com/user-attachments/assets/fbeb9a79-df8d-4e06-a339-2d4fc1ca70ef) ## Features From f9a5615c32a1a4a578ff5bf16972801b32e80a21 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 26 Sep 2026 11:47:23 +0000 Subject: [PATCH 3/3] README: remove empty image tag left above the title Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NHGQAYx5m3Fs5HUYPdtUWt --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 39b70bb..235a029 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -before_after # Python Syntax Enhanced [![Tests](https://github.com/aaronbcarlisle/python-syntax-enhanced/actions/workflows/test.yml/badge.svg)](https://github.com/aaronbcarlisle/python-syntax-enhanced/actions/workflows/test.yml)