Skip to content

Commit 4fc6d28

Browse files
committed
Fixed highlighting for decorators
1 parent 4f9e8d7 commit 4fc6d28

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

CHANGES.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Revision 3.0.2 (2009-07-24):
2+
3+
- Applied patch by Caleb Adamantine which fixes highlighting for decorators
4+
15
Revision 3.0.1 (2009-05-03):
26

37
- Fixed compatibility with pyrex.vim
@@ -16,6 +20,10 @@ Revision 3.0.0 (2008-12-07):
1620
"execfile", "file", "help", "intern", "long", "raw_input", "reduce",
1721
"reload", "unichr", "unicode", "xrange";
1822

23+
Revision 2.6.5 (2009-07-24):
24+
25+
- Applied patch by Caleb Adamantine which fixes highlighting for decorators
26+
1927
Revision 2.6.4 (2009-05-03):
2028

2129
- Fixed compatibility with pyrex.vim

python.vim

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
" Language: Python
33
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
44
" URL: http://www.hlabs.spb.ru/vim/python.vim
5-
" Last Change: 2008-09-29
5+
" Last Change: 2009-07-24
66
" Filenames: *.py
7-
" Version: 2.6.4
7+
" Version: 2.6.5
88
"
99
" Based on python.vim (from Vim 6.1 distribution)
1010
" by Neil Schemenauer <nas@python.ca>
@@ -18,6 +18,8 @@
1818
" (strings and comments)
1919
" John Eikenberry
2020
" for the patch fixing small typo
21+
" Caleb Adamantine
22+
" for the patch fixing highlighting for decorators
2123

2224
"
2325
" Options:
@@ -117,7 +119,9 @@ if !exists("python_print_as_function") || python_print_as_function == 0
117119
endif
118120

119121
" Decorators (new in Python 2.4)
120-
syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite
122+
syn match pythonDecorator "@" display nextgroup=pythonDottedName skipwhite
123+
syn match pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained
124+
syn match pythonDot "\." display containedin=pythonDottedName
121125

122126
" Comments
123127
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
@@ -303,6 +307,8 @@ if version >= 508 || !exists("did_python_syn_inits")
303307
HiLink pythonOperator Operator
304308

305309
HiLink pythonDecorator Define
310+
HiLink pythonDottedName Function
311+
HiLink pythonDot Normal
306312

307313
HiLink pythonComment Comment
308314
HiLink pythonCoding Special

python3.0.vim

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
" Language: Python
33
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
44
" URL: http://www.hlabs.spb.ru/vim/python3.0.vim
5-
" Last Change: 2008-12-07
5+
" Last Change: 2009-07-24
66
" Filenames: *.py
7-
" Version: 3.0.1
7+
" Version: 3.0.2
88
"
99
" Based on python.vim (from Vim 6.1 distribution)
1010
" by Neil Schemenauer <nas@python.ca>
@@ -18,6 +18,8 @@
1818
" (strings and comments)
1919
" John Eikenberry
2020
" for the patch fixing small typo
21+
" Caleb Adamantine
22+
" for the patch fixing highlighting for decorators
2123

2224
"
2325
" Options:
@@ -111,7 +113,9 @@ syn keyword pythonException try except finally
111113
syn keyword pythonOperator and in is not or
112114

113115
" Decorators (new in Python 2.4)
114-
syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite
116+
syn match pythonDecorator "@" display nextgroup=pythonDottedName skipwhite
117+
syn match pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained
118+
syn match pythonDot "\." display containedin=pythonDottedName
115119

116120
" Comments
117121
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
@@ -295,6 +299,8 @@ if version >= 508 || !exists("did_python_syn_inits")
295299
HiLink pythonOperator Operator
296300

297301
HiLink pythonDecorator Define
302+
HiLink pythonDottedName Function
303+
HiLink pythonDot Normal
298304

299305
HiLink pythonComment Comment
300306
HiLink pythonCoding Special

test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class Класс
4747
# Decorators.
4848

4949
@ decoratorname
50+
@ object.__init__(arg1, arg2)
5051

5152
# Numbers
5253

0 commit comments

Comments
 (0)