From a9486fe7e1291a997175d6ab74450a73ff3bc090 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 26 Sep 2025 07:54:19 +0800 Subject: [PATCH] vim-patch:900c747: runtime(python): fix 'type' syntax highlighting (#35918) The previous patterns unintentionally highlighted words like 'typename'. addresses: https://github.com/vim/vim/pull/18090#issuecomment-3333025523 closes: vim/vim#18394 https://github.com/vim/vim/commit/900c747da393b031f3347428fb640224ac2f5442 Co-authored-by: Jon Parise --- runtime/syntax/python.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim index 138a04b461..4d0c8d4581 100644 --- a/runtime/syntax/python.vim +++ b/runtime/syntax/python.vim @@ -2,6 +2,7 @@ " Language: Python " Maintainer: Zvezdan Petkovic " Last Change: 2025 Sep 08 +" 2025 Sep 25 by Vim Project: fix wrong type highlighting #18394 " Credits: Neil Schemenauer " Dmitry Vasiliev " Rob B @@ -308,7 +309,7 @@ if !exists("python_no_builtin_highlight") syn keyword pythonBuiltin setattr slice sorted staticmethod str sum super syn keyword pythonBuiltin tuple vars zip __import__ " only match `type` as a builtin when it's not followed by an identifier - syn match pythonBuiltin "\\ze\(\s\+\h\w*\)\@!" " avoid highlighting attributes as builtins syn match pythonAttribute /\.\h\w*/hs=s+1 \ contains=ALLBUT,pythonBuiltin,pythonClass,pythonFunction,pythonType,pythonAsync