Skip to content

Commit f259b31

Browse files
committed
Fixes for str.format syntax highlighting
1 parent 6f89b1c commit f259b31

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Revision 3.0.6 (2010-11-14):
2+
3+
- Fixed highlighting for str.format syntax. Patch by Anton Butanaev.
4+
15
Revision 3.0.5 (2010-11-11):
26

37
- Fixed highlighting for bytes. Patch by Anton Butanaev.

python3.0.vim

Lines changed: 4 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: 2010-11-11
5+
" Last Change: 2010-11-14
66
" Filenames: *.py
7-
" Version: 3.0.5
7+
" Version: 3.0.6
88
"
99
" Based on python.vim (from Vim 6.1 distribution)
1010
" by Neil Schemenauer <nas@python.ca>
@@ -24,6 +24,7 @@
2424
" for the patch with new configuration options
2525
" Anton Butanaev
2626
" for the patch fixing bytes literals highlighting
27+
" for the patch fixing str.format syntax highlighting
2728

2829
"
2930
" Options:
@@ -207,7 +208,7 @@ endif
207208
if exists("python_highlight_string_format") && python_highlight_string_format != 0
208209
" str.format syntax
209210
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
211212
endif
212213

213214
if exists("python_highlight_string_templates") && python_highlight_string_templates != 0

test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Класс
8686

8787
" %f "
8888

89-
"{0.name!r:b} {0[n]} {name!s: } {{test}} {{}}"
89+
"{0.name!r:b} {0[n]} {name!s: } {{test}} {{}} {} {.__len__:s}"
9090

9191
"${test} ${test ${test}aname $$$ $test+nope"
9292

0 commit comments

Comments
 (0)