@@ -52,14 +52,13 @@ if s:Enabled('g:python_highlight_all')
5252 call s: EnableByDefault (' g:python_highlight_space_errors' )
5353 call s: EnableByDefault (' g:python_highlight_doctests' )
5454 call s: EnableByDefault (' g:python_print_as_function' )
55+ call s: EnableByDefault (' g:python_highlight_class_vars' )
5556endif
5657
5758"
5859" Keywords
5960"
6061
61- syn keyword pythonInstanceVariable self
62- syn keyword pythonClassVariable cls
6362syn keyword pythonStatement break continue del
6463syn keyword pythonStatement exec return
6564syn keyword pythonStatement pass yield
@@ -68,6 +67,9 @@ syn keyword pythonStatement global assert
6867syn keyword pythonStatement lambda
6968syn keyword pythonStatement with
7069syn keyword pythonStatement def class nextgroup =pythonFunction skipwhite
70+ if s: Enabled (' g:python_highlight_class_vars' )
71+ syn keyword pythonClassVar self cls
72+ endif
7173syn keyword pythonRepeat for while
7274syn keyword pythonConditional if elif else
7375syn keyword pythonException try except finally
@@ -102,8 +104,7 @@ syn region FunctionParameters start='(\zs' end='\ze)' display contains=
102104 \ FunctionParameters,
103105 \ OptionalParameters,
104106 \ pythonRepeat,
105- \ pythonInstanceVariable,
106- \ pythonClassVariable,
107+ \ pythonClassVar,
107108 \ pythonConditional,
108109 \ pythonComment,
109110 \ pythonOperator,
@@ -125,7 +126,7 @@ syn region FunctionParameters start='(\zs' end='\ze)' display contains=
125126 \ pythonNone,
126127 \ pythonBuiltinFunc,
127128 \ pythonBoolean nextgroup= pythonRaiseFromStatement display contained
128- syn match OptionalParameters / \i * \z e=/ display contained
129+ syn match OptionalParameters / \i\+ \z e=/ display contained
129130"
130131" Decorators (new in Python 2.4)
131132"
@@ -486,9 +487,8 @@ if v:version >= 508 || !exists('did_python_syn_inits')
486487 HiLink pythonBuiltinFunc Function
487488
488489 HiLink pythonExClass Structure
489- HiLink pythonInstanceVariable htmlTagN
490- HiLink pythonClassVariable htmlTagN
491- HiLink OptionalParameters htmlTagN
490+ HiLink pythonClassVar Identifier
491+ HiLink OptionalParameters Identifier
492492
493493 delcommand HiLink
494494endif
0 commit comments