vim-patch:9.2.0354: filetype: not all Bitbake include files are recognized

Problem:  filetype: not all Bitbake include files are recognized
Solution: Enhance the file detection logic and consider varflags
          (Martin Schwan)

closes: vim/vim#19983

0e02be1919

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
This commit is contained in:
zeertzjq
2026-04-16 08:27:04 +08:00
parent e7f83fad39
commit 766efe5b51
2 changed files with 15 additions and 1 deletions

View File

@@ -936,7 +936,11 @@ function M.inc(path, bufnr)
elseif findany(line, { '^%s{', '^%s%(%*' }) or matchregex(line, pascal_keywords) then
return 'pascal'
elseif
findany(line, { '^%s*inherit ', '^%s*require ', '^%s*%u[%w_:${}/]*%s+%??[?:+.]?=.? ' })
matchregex(line, [[\<\%(require\|inherit\)\>]])
or matchregex(
line,
[=[[A-Z][A-Za-z0-9_:${}/]*\(\[[A-Za-z0-9_:/]\+\]\)*\s\+\%(??\|[?:+.]\)\?=.\? ]=]
)
then
return 'bitbake'
end