Skip to content

Commit f3bd1e1

Browse files
author
Michael Doronin
committed
2 parents 3422bba + 3ef357e commit f3bd1e1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

syntax/python.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ syn keyword pythonException try except finally
170170
syn keyword pythonOperator and in is not or
171171
syn match pythonStatement "^\s*yield\>" display
172172

173+
syn match pythonIdentifier "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters display
173174

174175
if s:Python2Syntax()
175176
if !s:Enabled("g:python_print_as_function")
@@ -180,8 +181,8 @@ if s:Python2Syntax()
180181
else
181182
syn keyword pythonStatement as nonlocal
182183
syn match pythonStatement "\v\s*<yield\s+from>" display
183-
syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
184184
syn match pythonStatement "\v(\.)@<!<await>"
185+
syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters display contained
185186
syn match pythonStatement "\<async\s\+def\>" nextgroup=pythonFunction skipwhite
186187
syn match pythonStatement "\<async\s\+with\>" display
187188
syn match pythonStatement "\<async\s\+for\>" display
@@ -195,7 +196,6 @@ syn region FunctionParameters start='(' end=')' display contains=
195196
\ pythonClassVaraible,
196197
\ pythonConditional,
197198
\ pythonComment,
198-
\ pythonImport,
199199
\ pythonOperator,
200200
\ pythonNumber,
201201
\ pythonNumberError,
@@ -214,7 +214,7 @@ syn region FunctionParameters start='(' end=')' display contains=
214214
\ pythonBuiltinObj,
215215
\ pythonBuiltinFunc,
216216
\ pythonBoolean
217-
\ nextgroup=OptionalParameters
217+
\ nextgroup=OptionalParameters display contained
218218
syn match OptionalParameters /\i*\ze=/ display contained
219219
"
220220
" Decorators (new in Python 2.4)
@@ -431,7 +431,7 @@ if s:Enabled("g:python_highlight_builtin_objs")
431431
syn keyword pythonBuiltinObj None
432432
syn keyword pythonBoolean True False
433433
syn keyword pythonBuiltinObj Ellipsis NotImplemented
434-
syn match pythonBuiltinObj '\v(\.)@<!<(object|bool|int|float|tuple|str|list|dict|set|frozenset|bytearray|bytes)>'
434+
syn match pythonBuiltinObj '\v(\.)@<!<(object|bool|int|float|tuple|str|list|dict|set|frozenset|bytearray|bytes)>' nextgroup=FunctionParameters
435435
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
436436
syn keyword pythonBuiltinObj __loader__ __spec__ __path__ __cached__
437437
endif

0 commit comments

Comments
 (0)