Skip to content

Commit dba9eb4

Browse files
jparisechrisbra
authored andcommitted
runtime(python): Also sync syntax at 'async def'
A file containing only async functions (`async def func()`) wouldn't previously match the pythonSync pattern. Also, this pattern only matches at the beginning of the line, so it won't ever match method definitions (which are indented within class scopes). Update the comment accordingly. closes: #17963 Signed-off-by: Jon Parise <[email protected]> Signed-off-by: Zvezdan Petkovic <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 6b9cf31 commit dba9eb4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

runtime/syntax/python.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Vim syntax file
22
" Language: Python
33
" Maintainer: Zvezdan Petkovic <[email protected]>
4-
" Last Change: 2025 Aug 10
4+
" Last Change: 2025 Aug 11
55
" Credits: Neil Schemenauer <[email protected]>
66
" Dmitry Vasiliev
77
" Rob B
@@ -367,8 +367,8 @@ if !exists("python_no_doctest_highlight")
367367
endif
368368
endif
369369

370-
" Sync at the beginning of class, function, or method definition.
371-
syn sync match pythonSync grouphere NONE "^\%(def\|class\)\s\+\h\w*\s*[(:]"
370+
" Sync at the beginning of (async) function or class definitions.
371+
syn sync match pythonSync grouphere NONE "^\%(async\s\+def\|def\|class\)\s\+\h\w*\s*[(:]"
372372

373373
" The default highlight links. Can be overridden later.
374374
hi def link pythonStatement Statement

0 commit comments

Comments
 (0)