contrib/vim: highlight inherit_defer and include_all
PATCH 1/1 contrib/vim: highlight inherit_defer and include_all
The vim syntax file's "Includes and requires" rule only matched inherit, include and require. BitBake also accepts the inherit_defer and include_all directives, so they should be highlighted the same way.
Add both keywords to bbInclude and to the bbIncludeLine match pattern. Longer keywords are listed first in the alternation so the regex does not match the shorter prefix (e.g. inherit_defer must win over inherit).
AI-Generated: codex/claude-opus 4.7 (xhigh)
--- contrib/vim/syntax/bitbake.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
contrib/vim/syntax/bitbake.vim +2 -2
@@ -62,9 +62,9 @@ syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.+]\+\ syn region bbVarFlagFlag matchgroup=bbArrayBrackets start="\[" end="\]\s*\(:=\|=\|.=\|=.|+=\|=+\|?=\)\@=" contained contains=bbIdentifier nextgroup=bbVarEq " Includes and requires -syn keyword bbInclude inherit include require contained +syn keyword bbInclude inherit inherit_defer include include_all require contained syn match bbIncludeRest ".*$" contained contains=bbString,bbVarDeref,bbVarPyValue -syn match bbIncludeLine "^\(inherit\|include\|require\)\s\+" contains=bbInclude nextgroup=bbIncludeRest +syn match bbIncludeLine "^\(inherit_defer\|inherit\|include_all\|include\|require\)\s\+" contains=bbInclude nextgroup=bbIncludeRest " Add taks and similar syn keyword bbStatement addtask deltask addhandler after before EXPORT_FUNCTIONS contained
Signature · 1 line
2.50.0.173.g8b6f19ccfc3a
Hi,
Quoted 9 lines · Trevor Woerner via lists.openembedded.org
The vim syntax file's "Includes and requires" rule only matched inherit, include and require. BitBake also accepts the
inherit_deferandinclude_alldirectives, so they should be highlighted the same way.Add both keywords to bbInclude and to the bbIncludeLine match pattern. Longer keywords are listed first in the alternation so the regex does not match the shorter prefix (e.g.
inherit_defermust win over inherit).
Why do we maintain a syntax file here since it's already part of upstream vim [1]?
[1]: https://github.com/vim/vim/blob/master/runtime/syntax/bitbake.vim
Antonin