runtime(bitbake): fix multiline Python function parameter syntax
Commit:
https://github.com/vim/vim/commit/5fe4faa711b5a4736529c94ace306de17d7a20de
Author: Martin Schwan <[email protected]>
Date: Mon Oct 13 18:50:20 2025 +0000
runtime(bitbake): fix multiline Python function parameter syntax
Fix syntax highlighting for def-style Python functions, with their
parameters spanning multiple lines. E.g. the following should match as
valid Python code in Bitbake recipes:
def myFunction(one, two, \
three, four):
pass
For this to work, use the prefix modifier "\_" before the wildcard ".",
to also match newline characters.
closes: #18565
Signed-off-by: Martin Schwan <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/syntax/bitbake.vim b/runtime/syntax/bitbake.vim
index 30f34474a..5e9bc5829 100644
--- a/runtime/syntax/bitbake.vim
+++ b/runtime/syntax/bitbake.vim
@@ -4,6 +4,8 @@
" Ricardo Salveti <[email protected]>
" Copyright: Copyright (C) 2004 Chris Larson <[email protected]>
" Copyright (C) 2008 Ricardo Salveti <[email protected]>
+" Last Change: 2022 Jul 25
+" 2025 Oct 13 by Vim project: update multiline function syntax #18565
"
" This file is licensed under the MIT license, see COPYING.MIT in
" this source distribution for the terms.
@@ -95,7 +97,7 @@ syn region bbPyFuncRegion matchgroup=bbDelimiter
start="{\s*$" end="^}\s*$
" BitBake 'def'd python functions
syn keyword bbPyDef def contained
-syn region bbPyDefRegion
start='^\(def\s\+\)\([0-9A-Za-z_-]\+\)\(\s*(.*)\s*\):\s*$' end='^\(\s\|$\)\@!'
contains=@python
+syn region bbPyDefRegion
start='^\(def\s\+\)\([0-9A-Za-z_-]\+\)\(\s*(\_.*)\s*\):\s*$'
end='^\(\s\|$\)\@!' contains=@python
" Highlighting Definitions
hi def link bbUnmatched Error
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1v8Nm8-00CiLN-5c%40256bit.org.