Fixed highlighting for decorators

This commit is contained in:
Dmitry Vasiliev
2009-07-24 13:09:13 +04:00
parent 4f9e8d7c0f
commit 4fc6d28416
4 changed files with 27 additions and 6 deletions

View File

@@ -1,3 +1,7 @@
Revision 3.0.2 (2009-07-24):
- Applied patch by Caleb Adamantine which fixes highlighting for decorators
Revision 3.0.1 (2009-05-03): Revision 3.0.1 (2009-05-03):
- Fixed compatibility with pyrex.vim - Fixed compatibility with pyrex.vim
@@ -16,6 +20,10 @@ Revision 3.0.0 (2008-12-07):
"execfile", "file", "help", "intern", "long", "raw_input", "reduce", "execfile", "file", "help", "intern", "long", "raw_input", "reduce",
"reload", "unichr", "unicode", "xrange"; "reload", "unichr", "unicode", "xrange";
Revision 2.6.5 (2009-07-24):
- Applied patch by Caleb Adamantine which fixes highlighting for decorators
Revision 2.6.4 (2009-05-03): Revision 2.6.4 (2009-05-03):
- Fixed compatibility with pyrex.vim - Fixed compatibility with pyrex.vim

View File

@@ -2,9 +2,9 @@
" Language: Python " Language: Python
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru> " Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
" URL: http://www.hlabs.spb.ru/vim/python.vim " URL: http://www.hlabs.spb.ru/vim/python.vim
" Last Change: 2008-09-29 " Last Change: 2009-07-24
" Filenames: *.py " Filenames: *.py
" Version: 2.6.4 " Version: 2.6.5
" "
" Based on python.vim (from Vim 6.1 distribution) " Based on python.vim (from Vim 6.1 distribution)
" by Neil Schemenauer <nas@python.ca> " by Neil Schemenauer <nas@python.ca>
@@ -18,6 +18,8 @@
" (strings and comments) " (strings and comments)
" John Eikenberry " John Eikenberry
" for the patch fixing small typo " for the patch fixing small typo
" Caleb Adamantine
" for the patch fixing highlighting for decorators
" "
" Options: " Options:
@@ -117,7 +119,9 @@ if !exists("python_print_as_function") || python_print_as_function == 0
endif endif
" Decorators (new in Python 2.4) " Decorators (new in Python 2.4)
syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite syn match pythonDecorator "@" display nextgroup=pythonDottedName skipwhite
syn match pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained
syn match pythonDot "\." display containedin=pythonDottedName
" Comments " Comments
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
@@ -303,6 +307,8 @@ if version >= 508 || !exists("did_python_syn_inits")
HiLink pythonOperator Operator HiLink pythonOperator Operator
HiLink pythonDecorator Define HiLink pythonDecorator Define
HiLink pythonDottedName Function
HiLink pythonDot Normal
HiLink pythonComment Comment HiLink pythonComment Comment
HiLink pythonCoding Special HiLink pythonCoding Special

View File

@@ -2,9 +2,9 @@
" Language: Python " Language: Python
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru> " Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
" URL: http://www.hlabs.spb.ru/vim/python3.0.vim " URL: http://www.hlabs.spb.ru/vim/python3.0.vim
" Last Change: 2008-12-07 " Last Change: 2009-07-24
" Filenames: *.py " Filenames: *.py
" Version: 3.0.1 " Version: 3.0.2
" "
" Based on python.vim (from Vim 6.1 distribution) " Based on python.vim (from Vim 6.1 distribution)
" by Neil Schemenauer <nas@python.ca> " by Neil Schemenauer <nas@python.ca>
@@ -18,6 +18,8 @@
" (strings and comments) " (strings and comments)
" John Eikenberry " John Eikenberry
" for the patch fixing small typo " for the patch fixing small typo
" Caleb Adamantine
" for the patch fixing highlighting for decorators
" "
" Options: " Options:
@@ -111,7 +113,9 @@ syn keyword pythonException try except finally
syn keyword pythonOperator and in is not or syn keyword pythonOperator and in is not or
" Decorators (new in Python 2.4) " Decorators (new in Python 2.4)
syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite syn match pythonDecorator "@" display nextgroup=pythonDottedName skipwhite
syn match pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained
syn match pythonDot "\." display containedin=pythonDottedName
" Comments " Comments
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
@@ -295,6 +299,8 @@ if version >= 508 || !exists("did_python_syn_inits")
HiLink pythonOperator Operator HiLink pythonOperator Operator
HiLink pythonDecorator Define HiLink pythonDecorator Define
HiLink pythonDottedName Function
HiLink pythonDot Normal
HiLink pythonComment Comment HiLink pythonComment Comment
HiLink pythonCoding Special HiLink pythonCoding Special

View File

@@ -47,6 +47,7 @@ RuntimeWarning FutureWarning OverflowWarning ImportWarning UnicodeWarning
# Decorators. # Decorators.
@ decoratorname @ decoratorname
@ object.__init__(arg1, arg2)
# Numbers # Numbers