vim-patch:916809a: runtime(python): highlight the 'lazy' soft keyword

Lazy imports (PEP 810, to be released in Python 3.15) introduces a
`lazy` soft keyword that's recognized when it precedes a `from` or
`import` keyword.

closes: vim/vim#20342

916809ae1e

Co-authored-by: Jon Parise <jon@indelible.org>
This commit is contained in:
zeertzjq
2026-07-27 06:31:55 +08:00
parent 1d36cf1dbe
commit 1c83e43f27

View File

@@ -6,6 +6,7 @@
" 2025 Dec 03 by Vim Project: highlight t-strings #18679
" 2026 Jan 26 by Vim Project: highlight constants #18922
" 2026 Mar 11 by Vim Project: fix number performance #19630
" 2026 May 27 by Vim Project: highlight `lazy` soft keyword (PEP 810) #20342
" Credits: Neil Schemenauer <nas@python.ca>
" Dmitry Vasiliev
" Rob B
@@ -120,6 +121,7 @@ syn keyword pythonAsync async await
" for more on this.
syn match pythonConditional "^\s*\zscase\%(\s\+.*:.*$\)\@="
syn match pythonConditional "^\s*\zsmatch\%(\s\+.*:\s*\%(#.*\)\=$\)\@="
syn match pythonInclude "^\s*\zslazy\ze\s\+\%(from\|import\)\>"
syn match pythonStatement "\<type\ze\s\+\h\w*" nextgroup=pythonType skipwhite
" These names are special by convention. While they aren't real keywords,