commit 3d511833ae14dac2ca575322ccb2a4f0169c1460
parent ba25f3e4d40f6807b7f1a3d558c51ccee6ea8877
Author: zeertzjq <zeertzjq@outlook.com>
Date: Wed, 20 Aug 2025 07:24:13 +0800
vim-patch:2f7e4eb: runtime(python): optimize pythonSync pattern
Order the keywords by expected frequency: "def" and "class" are assumed
to be more likely than "async def" in the majority of Python code.
closes: vim/vim#18032
https://github.com/vim/vim/commit/2f7e4eb335df389d73aaeb2ff6879b233c1a293f
Co-authored-by: Jon Parise <jon@indelible.org>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Python
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
-" Last Change: 2025 Aug 13
+" Last Change: 2025 Aug 18
" Credits: Neil Schemenauer <nas@python.ca>
" Dmitry Vasiliev
" Rob B
@@ -372,7 +372,7 @@ if !exists("python_no_doctest_highlight")
endif
" Sync at the beginning of (async) function or class definitions.
-syn sync match pythonSync grouphere NONE "^\%(async\s\+def\|def\|class\)\s\+\h\w*\s*[(:]"
+syn sync match pythonSync grouphere NONE "^\%(def\|class\|async\s\+def\)\s\+\h\w*\s*[(:]"
" The default highlight links. Can be overridden later.
hi def link pythonStatement Statement