Permalink
Browse files

Fixes for str.format syntax highlighting

  • Loading branch information...
hdima committed Nov 14, 2010
1 parent 805a0bf commit e9210146a81033d4aa866f21b2c7f2d4db2366a9
Showing with 9 additions and 4 deletions.
  1. +4 −0 syntax/python/CHANGES.txt
  2. +4 −3 syntax/python/python3.0.vim
  3. +1 −1 syntax/python/test.py
@@ -1,3 +1,7 @@
+Revision 3.0.6 (2010-11-14):
+
+ - Fixed highlighting for str.format syntax. Patch by Anton Butanaev.
+
Revision 3.0.5 (2010-11-11):
- Fixed highlighting for bytes. Patch by Anton Butanaev.
@@ -2,9 +2,9 @@
" Language: Python
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
" URL: http://www.hlabs.spb.ru/vim/python3.0.vim
-" Last Change: 2010-11-11
+" Last Change: 2010-11-14
" Filenames: *.py
-" Version: 3.0.5
+" Version: 3.0.6
"
" Based on python.vim (from Vim 6.1 distribution)
" by Neil Schemenauer <nas@python.ca>
@@ -24,6 +24,7 @@
" for the patch with new configuration options
" Anton Butanaev
" for the patch fixing bytes literals highlighting
+" for the patch fixing str.format syntax highlighting
"
" Options:
@@ -207,7 +208,7 @@ endif
if exists("python_highlight_string_format") && python_highlight_string_format != 0
" str.format syntax
syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonRawString
- 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
+ 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
endif
if exists("python_highlight_string_templates") && python_highlight_string_templates != 0
View
@@ -86,7 +86,7 @@ class Класс
" %f "
-"{0.name!r:b} {0[n]} {name!s: } {{test}} {{}}"
+"{0.name!r:b} {0[n]} {name!s: } {{test}} {{}} {} {.__len__:s}"
"${test} ${test ${test}aname $$$ $test+nope"

0 comments on commit e921014

Please sign in to comment.