Browse Source

Allow None to be highlighted differently

Jake Harr 7 years ago
parent
commit
7a890a2fe3
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      syntax/python.vim

+ 5
- 2
syntax/python.vim View File

@@ -176,7 +176,8 @@ if s:Python2Syntax()
176 176
   syn keyword pythonImport      as
177 177
   syn match   pythonFunction    "[a-zA-Z_][a-zA-Z0-9_]*" display contained
178 178
 else
179
-  syn keyword pythonStatement   as nonlocal None
179
+  syn keyword pythonStatement   as nonlocal
180
+  syn keyword pythonNone        None
180 181
   syn match   pythonStatement   "\<yield\s\+from\>" display
181 182
   syn keyword pythonBoolean     True False
182 183
   syn match   pythonFunction    "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
@@ -399,7 +400,7 @@ syn match   pythonFloat		"\<\d\+\.\d*\%([eE][+-]\=\d\+\)\=[jJ]\=" display
399 400
 
400 401
 if s:Enabled("g:python_highlight_builtin_objs")
401 402
   if s:Python2Syntax()
402
-    syn keyword pythonBuiltinObj	None
403
+    syn keyword pythonNone	        None
403 404
     syn keyword pythonBoolean		True False
404 405
   endif
405 406
   syn keyword pythonBuiltinObj	Ellipsis NotImplemented
@@ -529,6 +530,7 @@ if version >= 508 || !exists("did_python_syn_inits")
529 530
     HiLink pythonUniRawString       String
530 531
     HiLink pythonUniRawEscape       Special
531 532
     HiLink pythonUniRawEscapeError  Error
533
+    HiLink pythonNone               pythonBuiltinObj
532 534
   else
533 535
     HiLink pythonBytes              String
534 536
     HiLink pythonRawBytes           String
@@ -536,6 +538,7 @@ if version >= 508 || !exists("did_python_syn_inits")
536 538
     HiLink pythonBytesError         Error
537 539
     HiLink pythonBytesEscape        Special
538 540
     HiLink pythonBytesEscapeError   Error
541
+    HiLink pythonNone               pythonStatement
539 542
   endif
540 543
 
541 544
   HiLink pythonStrFormatting    Special