Browse Source

Fixes for str.format syntax highlighting

Dmitry Vasiliev 14 years ago
parent
commit
f259b31b50
3 changed files with 9 additions and 4 deletions
  1. 4
    0
      CHANGES.txt
  2. 4
    3
      python3.0.vim
  3. 1
    1
      test.py

+ 4
- 0
CHANGES.txt View File

1
+Revision 3.0.6 (2010-11-14):
2
+
3
+    - Fixed highlighting for str.format syntax. Patch by Anton Butanaev.
4
+
1
 Revision 3.0.5 (2010-11-11):
5
 Revision 3.0.5 (2010-11-11):
2
 
6
 
3
     - Fixed highlighting for bytes. Patch by Anton Butanaev.
7
     - Fixed highlighting for bytes. Patch by Anton Butanaev.

+ 4
- 3
python3.0.vim View File

2
 " Language:	Python
2
 " Language:	Python
3
 " Maintainer:	Dmitry Vasiliev <dima@hlabs.spb.ru>
3
 " Maintainer:	Dmitry Vasiliev <dima@hlabs.spb.ru>
4
 " URL:		http://www.hlabs.spb.ru/vim/python3.0.vim
4
 " URL:		http://www.hlabs.spb.ru/vim/python3.0.vim
5
-" Last Change:	2010-11-11
5
+" Last Change:	2010-11-14
6
 " Filenames:	*.py
6
 " Filenames:	*.py
7
-" Version:	3.0.5
7
+" Version:	3.0.6
8
 "
8
 "
9
 " Based on python.vim (from Vim 6.1 distribution)
9
 " Based on python.vim (from Vim 6.1 distribution)
10
 " by Neil Schemenauer <nas@python.ca>
10
 " by Neil Schemenauer <nas@python.ca>
24
 "        for the patch with new configuration options
24
 "        for the patch with new configuration options
25
 "    Anton Butanaev
25
 "    Anton Butanaev
26
 "        for the patch fixing bytes literals highlighting
26
 "        for the patch fixing bytes literals highlighting
27
+"        for the patch fixing str.format syntax highlighting
27
 
28
 
28
 "
29
 "
29
 " Options:
30
 " Options:
207
 if exists("python_highlight_string_format") && python_highlight_string_format != 0
208
 if exists("python_highlight_string_format") && python_highlight_string_format != 0
208
   " str.format syntax
209
   " str.format syntax
209
   syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonRawString
210
   syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonRawString
210
-  syn match pythonStrFormat	"{\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_*\)\|\[\%(\d\+\|[^!:\}]\+\)\]\)*\%(![rsa]\)\=\%(:\%({\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)}\|\%([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*\%(\.\d\+\)\=[bcdeEfFgGnoxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonRawString
211
+  syn match pythonStrFormat	"{\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)\=\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\[\%(\d\+\|[^!:\}]\+\)\]\)*\%(![rsa]\)\=\%(:\%({\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)}\|\%([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*,\=\%(\.\d\+\)\=[bcdeEfFgGnosxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonRawString
211
 endif
212
 endif
212
 
213
 
213
 if exists("python_highlight_string_templates") && python_highlight_string_templates != 0
214
 if exists("python_highlight_string_templates") && python_highlight_string_templates != 0

+ 1
- 1
test.py View File

86
 
86
 
87
 " %f "
87
 " %f "
88
 
88
 
89
-"{0.name!r:b} {0[n]} {name!s:  } {{test}} {{}}"
89
+"{0.name!r:b} {0[n]} {name!s:  } {{test}} {{}} {} {.__len__:s}"
90
 
90
 
91
 "${test} ${test ${test}aname $$$ $test+nope"
91
 "${test} ${test ${test}aname $$$ $test+nope"
92
 
92