aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2026-07-27 06:31:55 +0800
committerzeertzjq <zeertzjq@outlook.com>2026-07-27 06:31:58 +0800
commit1c83e43f27394d8bcb32d72ee2a052d3867788cc (patch)
treeea4fbc390a51b3ffe6d4bee34d107c58527d11ef /runtime
parent1d36cf1dbed58db9ae72367eef07b5698584bcd5 (diff)
downloadrneovim-1c83e43f27394d8bcb32d72ee2a052d3867788cc.tar.gz
rneovim-1c83e43f27394d8bcb32d72ee2a052d3867788cc.tar.bz2
rneovim-1c83e43f27394d8bcb32d72ee2a052d3867788cc.zip
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 https://github.com/vim/vim/commit/916809ae1e3e562e0a6220a6e7e08f38b8a23b62 Co-authored-by: Jon Parise <jon@indelible.org>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/syntax/python.vim2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim
index 24c2657e15..aa5c36e0ad 100644
--- a/runtime/syntax/python.vim
+++ b/runtime/syntax/python.vim
@@ -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,