From bbed01805079561f467f44421b31e87b3bfefe5c Mon Sep 17 00:00:00 2001 From: Michael Doronin Date: Sat, 19 Nov 2016 13:00:07 +0300 Subject: [PATCH] keyword arguments and optional parameters are only highlighted inside actual function calls and function defenitions --- syntax/python.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syntax/python.vim b/syntax/python.vim index e9318f3..e110516 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -170,6 +170,7 @@ syn keyword pythonException try except finally syn keyword pythonOperator and in is not or syn match pythonStatement "^\s*yield\>" display +syn match pythonIdentifier "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters display if s:Python2Syntax() if !s:Enabled("g:python_print_as_function") @@ -180,7 +181,7 @@ if s:Python2Syntax() else syn keyword pythonStatement as nonlocal syn match pythonStatement "\" display - syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained + syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" nextgroup=FunctionParameters display contained syn keyword pythonStatement await syn match pythonStatement "\" nextgroup=pythonFunction skipwhite syn match pythonStatement "\" display @@ -195,7 +196,6 @@ syn region FunctionParameters start='(' end=')' display contains= \ pythonClassVaraible, \ pythonConditional, \ pythonComment, - \ pythonImport, \ pythonOperator, \ pythonNumber, \ pythonNumberError, @@ -214,7 +214,7 @@ syn region FunctionParameters start='(' end=')' display contains= \ pythonBuiltinObj, \ pythonBuiltinFunc, \ pythonBoolean - \ nextgroup=OptionalParameters + \ nextgroup=OptionalParameters display contained syn match OptionalParameters /\i*\ze=/ display contained " " Decorators (new in Python 2.4)