@@ -54,6 +54,7 @@ if s:Enabled('g:python_highlight_all')
5454 call s: EnableByDefault (' g:python_highlight_space_errors' )
5555 call s: EnableByDefault (' g:python_highlight_doctests' )
5656 call s: EnableByDefault (' g:python_print_as_function' )
57+ call s: EnableByDefault (' g:python_highlight_func_calls' )
5758 call s: EnableByDefault (' g:python_highlight_class_vars' )
5859 call s: EnableByDefault (' g:python_highlight_operators' )
5960endif
6465
6566syn keyword pythonStatement break continue del return pass yield global assert lambda with
6667syn keyword pythonStatement raise nextgroup =pythonExClass skipwhite
67- syn keyword pythonStatement def class nextgroup =pythonFunction skipwhite
68+ syn keyword pythonStatement def class nextgroup =pythonFunctionContained skipwhite
6869if s: Enabled (' g:python_highlight_class_vars' )
6970 syn keyword pythonClassVar self cls
7071endif
@@ -85,12 +86,12 @@ if s:Python2Syntax()
8586 endif
8687 syn keyword pythonStatement exec
8788 syn keyword pythonImport as
88- syn match pythonFunction ' [a-zA-Z_][a-zA-Z0-9_]*' display contained
89+ syn match pythonFunctionContained ' [a-zA-Z_][a-zA-Z0-9_]*' display contained
8990else
9091 syn keyword pythonStatement as nonlocal
9192 syn match pythonStatement ' \v\. @<!<await>'
92- syn match pythonFunction ' \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *' display contained
93- syn match pythonStatement ' \< async\s\+ def\> ' nextgroup =pythonFunction skipwhite
93+ syn match pythonFunctionContained ' \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *' display contained
94+ syn match pythonStatement ' \< async\s\+ def\> ' nextgroup =pythonFunctionContained skipwhite
9495 syn match pythonStatement ' \< async\s\+ with\> '
9596 syn match pythonStatement ' \< async\s\+ for\> '
9697 syn cluster pythonExpression contains =pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonBytes,pythonBoolean,pythonNone,pythonSingleton,pythonBuiltinObj,pythonBuiltinFunc,pythonBuiltinType
@@ -394,6 +395,18 @@ if s:Enabled('g:python_highlight_exceptions')
394395 unlet s: exs_re
395396endif
396397
398+ "
399+ " Function calls
400+ "
401+
402+ if s: Enabled (' g:python_highlight_func_calls' )
403+ syn match pythonFunctionCall ' \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *\z e\% (\s *(\) '
404+ endif
405+
406+ "
407+ " Misc
408+ "
409+
397410if s: Enabled (' g:python_slow_sync' )
398411 syn sync minlines =2000
399412else
@@ -415,7 +428,8 @@ if v:version >= 508 || !exists('did_python_syn_inits')
415428 HiLink pythonStatement Statement
416429 HiLink pythonRaiseFromStatement Statement
417430 HiLink pythonImport Include
418- HiLink pythonFunction Function
431+ HiLink pythonFunctionContained Function
432+ HiLink pythonFunctionCall Function
419433 HiLink pythonConditional Conditional
420434 HiLink pythonRepeat Repeat
421435 HiLink pythonException Exception
0 commit comments