mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
runtime(python): Update syntax file, fix f-string float highlighting
Fix matching of floats at the beginning of an f-string replacement field, immediately after the opening brace. The existing pattern, using `\zs`, cannot consume the already matched `{` so use a lookbehind instead. See comment: https://github.com/vim/vim/pull/17962#issuecomment-3201550443 closes: #18220 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
fa6fd41a94
commit
6bb16d2cee
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Python
|
||||
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
|
||||
" Last Change: 2025 Sep 05
|
||||
" Last Change: 2025 Sep 08
|
||||
" Credits: Neil Schemenauer <nas@python.ca>
|
||||
" Dmitry Vasiliev
|
||||
" Rob B
|
||||
@@ -271,7 +271,7 @@ if !exists("python_no_number_highlight")
|
||||
syn match pythonNumber
|
||||
\ "\<\d\%(_\=\d\)*\.\%([eE][+-]\=\d\%(_\=\d\)*\)\=[jJ]\=\%(\W\|$\)\@="
|
||||
syn match pythonNumber
|
||||
\ "\%(^\|\W\)\zs\%(\d\%(_\=\d\)*\)\=\.\d\%(_\=\d\)*\%([eE][+-]\=\d\%(_\=\d\)*\)\=[jJ]\=\>"
|
||||
\ "\%(^\|\W\)\@1<=\%(\d\%(_\=\d\)*\)\=\.\d\%(_\=\d\)*\%([eE][+-]\=\d\%(_\=\d\)*\)\=[jJ]\=\>"
|
||||
endif
|
||||
|
||||
" Group the built-ins in the order in the 'Python Library Reference' for
|
||||
|
Reference in New Issue
Block a user