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