瀏覽代碼

Fix decorators to allow the same kind of characters that functions do

Victor Salgado 10 年之前
父節點
當前提交
9dc6765ad1
共有 2 個檔案被更改,包括 2 行新增1 行删除
  1. 1
    1
      syntax/python.vim
  2. 1
    0
      test.py

+ 1
- 1
syntax/python.vim 查看文件

179
 "
179
 "
180
 
180
 
181
 syn match   pythonDecorator	"@" display nextgroup=pythonDottedName skipwhite
181
 syn match   pythonDecorator	"@" display nextgroup=pythonDottedName skipwhite
182
-syn match   pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\%(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained
182
+syn match   pythonDottedName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\)*" display contained
183
 syn match   pythonDot        "\." display containedin=pythonDottedName
183
 syn match   pythonDot        "\." display containedin=pythonDottedName
184
 
184
 
185
 "
185
 "

+ 1
- 0
test.py 查看文件

51
 
51
 
52
 @ decoratorname
52
 @ decoratorname
53
 @ object.__init__(arg1, arg2)
53
 @ object.__init__(arg1, arg2)
54
+@ декоратор.décorateur
54
 
55
 
55
 # Numbers
56
 # Numbers
56
 
57