aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/python.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2026-09-11 08:56:55 +0800
committerzeertzjq <zeertzjq@outlook.com>2026-09-11 08:56:58 +0800
commit619d3ee5cf14c4b5d39d72481a3362002bef82ab (patch)
treeda91e885ba9efe00e2b2de4077b31739e2af4065 /runtime/syntax/python.vim
parent26e3c1824c102b5ffd34b0eb5e2a0b469f0bf1a8 (diff)
downloadrneovim-619d3ee5cf14c4b5d39d72481a3362002bef82ab.tar.gz
rneovim-619d3ee5cf14c4b5d39d72481a3362002bef82ab.tar.bz2
rneovim-619d3ee5cf14c4b5d39d72481a3362002bef82ab.zip
vim-patch:cbcb209: runtime(python): missing Python syntax keywords
Problem: Missing newer Python keywords and builtins in syntax highlighting. Solution: Add aiter, anext, BaseExceptionGroup, ExceptionGroup, PythonFinalizationError, and EncodingWarning to the Python syntax file (231tr0n). closes: vim/vim#21254 https://github.com/vim/vim/commit/cbcb209221a2e19f674c7b2ed789132606761b7c Co-authored-by: 231tr0n <zeltronsrikar@gmail.com>
Diffstat (limited to 'runtime/syntax/python.vim')
-rw-r--r--runtime/syntax/python.vim9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim
index 0881a4cd03..36a7b1cf08 100644
--- a/runtime/syntax/python.vim
+++ b/runtime/syntax/python.vim
@@ -8,6 +8,7 @@
" 2026 Mar 11 by Vim Project: fix number performance #19630
" 2026 May 27 by Vim Project: highlight `lazy` soft keyword (PEP 810) #20342
" 2026 Aug 30 by Vim Project: improve number and ellipsis performance
+" 2026 Sep 10 by Vim Project: add new builtins #21254
" Credits: Neil Schemenauer <nas@python.ca>
" Dmitry Vasiliev
" Rob B
@@ -314,7 +315,7 @@ if !exists("python_no_builtin_highlight")
" constants added by the `site` module
syn keyword pythonBuiltin quit exit copyright credits license
" built-in functions
- syn keyword pythonBuiltin abs all any ascii bin bool breakpoint bytearray
+ syn keyword pythonBuiltin abs aiter all anext any ascii bin bool breakpoint bytearray
syn keyword pythonBuiltin bytes callable chr classmethod compile complex
syn keyword pythonBuiltin delattr dict dir divmod enumerate eval exec
syn keyword pythonBuiltin filter float format frozenset getattr globals
@@ -339,7 +340,7 @@ endif
" http://docs.python.org/library/exceptions.html
if !exists("python_no_exception_highlight")
" builtin base exceptions (used mostly as base classes for other exceptions)
- syn keyword pythonExceptions BaseException Exception
+ syn keyword pythonExceptions BaseException Exception BaseExceptionGroup ExceptionGroup
syn keyword pythonExceptions ArithmeticError BufferError LookupError
" builtin exceptions (actually raised)
syn keyword pythonExceptions AssertionError AttributeError EOFError
@@ -348,7 +349,7 @@ if !exists("python_no_exception_highlight")
syn keyword pythonExceptions KeyboardInterrupt MemoryError
syn keyword pythonExceptions ModuleNotFoundError NameError
syn keyword pythonExceptions NotImplementedError OSError OverflowError
- syn keyword pythonExceptions RecursionError ReferenceError RuntimeError
+ syn keyword pythonExceptions PythonFinalizationError RecursionError ReferenceError RuntimeError
syn keyword pythonExceptions StopAsyncIteration StopIteration SyntaxError
syn keyword pythonExceptions SystemError SystemExit TabError TypeError
syn keyword pythonExceptions UnboundLocalError UnicodeDecodeError
@@ -366,7 +367,7 @@ if !exists("python_no_exception_highlight")
syn keyword pythonExceptions IsADirectoryError NotADirectoryError
syn keyword pythonExceptions PermissionError ProcessLookupError TimeoutError
" builtin warnings
- syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
+ syn keyword pythonExceptions BytesWarning DeprecationWarning EncodingWarning FutureWarning
syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
syn keyword pythonExceptions ResourceWarning RuntimeWarning
syn keyword pythonExceptions SyntaxWarning UnicodeWarning