diff --git a/CHANGES.txt b/CHANGES.txt index fae61b0..8bacd7d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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): - Fixed compatibility with pyrex.vim @@ -16,6 +20,10 @@ Revision 3.0.0 (2008-12-07): "execfile", "file", "help", "intern", "long", "raw_input", "reduce", "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): - Fixed compatibility with pyrex.vim diff --git a/python.vim b/python.vim index a9924cc..04cf875 100644 --- a/python.vim +++ b/python.vim @@ -2,9 +2,9 @@ " Language: Python " Maintainer: Dmitry Vasiliev " URL: http://www.hlabs.spb.ru/vim/python.vim -" Last Change: 2008-09-29 +" Last Change: 2009-07-24 " Filenames: *.py -" Version: 2.6.4 +" Version: 2.6.5 " " Based on python.vim (from Vim 6.1 distribution) " by Neil Schemenauer @@ -18,6 +18,8 @@ " (strings and comments) " John Eikenberry " for the patch fixing small typo +" Caleb Adamantine +" for the patch fixing highlighting for decorators " " Options: @@ -117,7 +119,9 @@ if !exists("python_print_as_function") || python_print_as_function == 0 endif " 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 syn match pythonComment "#.*$" display contains=pythonTodo,@Spell @@ -303,6 +307,8 @@ if version >= 508 || !exists("did_python_syn_inits") HiLink pythonOperator Operator HiLink pythonDecorator Define + HiLink pythonDottedName Function + HiLink pythonDot Normal HiLink pythonComment Comment HiLink pythonCoding Special diff --git a/python3.0.vim b/python3.0.vim index 60c9eb0..b8a7726 100644 --- a/python3.0.vim +++ b/python3.0.vim @@ -2,9 +2,9 @@ " Language: Python " Maintainer: Dmitry Vasiliev " URL: http://www.hlabs.spb.ru/vim/python3.0.vim -" Last Change: 2008-12-07 +" Last Change: 2009-07-24 " Filenames: *.py -" Version: 3.0.1 +" Version: 3.0.2 " " Based on python.vim (from Vim 6.1 distribution) " by Neil Schemenauer @@ -18,6 +18,8 @@ " (strings and comments) " John Eikenberry " for the patch fixing small typo +" Caleb Adamantine +" for the patch fixing highlighting for decorators " " Options: @@ -111,7 +113,9 @@ syn keyword pythonException try except finally syn keyword pythonOperator and in is not or " 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 syn match pythonComment "#.*$" display contains=pythonTodo,@Spell @@ -295,6 +299,8 @@ if version >= 508 || !exists("did_python_syn_inits") HiLink pythonOperator Operator HiLink pythonDecorator Define + HiLink pythonDottedName Function + HiLink pythonDot Normal HiLink pythonComment Comment HiLink pythonCoding Special diff --git a/test.py b/test.py index 4a92f01..0557ec3 100644 --- a/test.py +++ b/test.py @@ -47,6 +47,7 @@ RuntimeWarning FutureWarning OverflowWarning ImportWarning UnicodeWarning # Decorators. @ decoratorname +@ object.__init__(arg1, arg2) # Numbers