From fd14874ed430a66732c9255d491dd910e6782fb7 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sat, 4 Mar 2017 09:14:32 -0800 Subject: [PATCH] Don't highlight builtins used as kwarg. Don't highlight builtins immediately followed by an equal sign, as they are likely being used as keyword argument to a function, e.g. `func(min=foo, max=bar)`. (Similarly to the case of attributes named using a builtin, it is unlikely that client code has the choice there anyways.) --- syntax/python.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/python.vim b/syntax/python.vim index c7d72a0..32e9978 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -352,7 +352,7 @@ if s:Enabled('g:python_highlight_builtin_funcs') let s:funcs_re .= '|ascii|exec|print' endif - execute 'syn match pythonBuiltinFunc ''\v\.@''' + execute 'syn match pythonBuiltinFunc ''\v\.@\=@!''' unlet s:funcs_re endif @@ -369,7 +369,7 @@ if s:Enabled('g:python_highlight_exceptions') let s:exs_re .= '|BlockingIOError|ChildProcessError|ConnectionError|BrokenPipeError|ConnectionAbortedError|ConnectionRefusedError|ConnectionResetError|FileExistsError|FileNotFoundError|InterruptedError|IsADirectoryError|NotADirectoryError|PermissionError|ProcessLookupError|TimeoutError|StopAsyncIteration|ResourceWarning' endif - execute 'syn match pythonExClass ''\v\.@''' + execute 'syn match pythonExClass ''\v\.@\=@!''' unlet s:exs_re endif