mirror of
https://github.com/neovim/neovim.git
synced 2026-05-27 07:18:36 +00:00
vim-patch:9.2.0539: filetype: too many Bitbake include files are recognized (#40014)
Problem: filetype: too many Bitbake include files are recognized
(Brahmajit Das, after v9.1.1732)
Solution: Tighten the pattern to detect BitBake include files, update
tests (Martin Schwan).
Be more strict when detecting BitBake inc files. In particular, only
match include keywords and variable assignments at the beginning of a
line (excluding whitespace).
Use non-capturing groups to slightly improve performance.
Use regex or-operators to exactly match BitBake assignment operators.
The previous expression would falsely match
FOO .=. "bar"
, which is not valid BitBake syntax. The new capturing group is more
specific and matches only valid assignments.
fixes: vim/vim#20288
closes: vim/vim#20335
2df68c8e4b
Co-authored-by: Martin Schwan <m.schwan@phytec.de>
This commit is contained in:
@@ -936,10 +936,10 @@ function M.inc(path, bufnr)
|
||||
elseif findany(line, { '^%s{', '^%s%(%*' }) or matchregex(line, pascal_keywords) then
|
||||
return 'pascal'
|
||||
elseif
|
||||
matchregex(line, [[\<\%(require\|inherit\)\>]])
|
||||
matchregex(line, [[^\s*\<\%(require\|inherit\)\>]])
|
||||
or matchregex(
|
||||
line,
|
||||
[=[[A-Z][A-Za-z0-9_:${}/]*\(\[[A-Za-z0-9_:/]\+\]\)*\s\+\%(??\|[?:+.]\)\?=.\? ]=]
|
||||
[=[^\s*[A-Z][A-Za-z0-9_:${}/]*\%(\[[A-Za-z0-9_:/]\+\]\)*\s\+\%(??=\|[?:+.]=\|=[+.]\?\)\s\+]=]
|
||||
)
|
||||
then
|
||||
return 'bitbake'
|
||||
|
||||
Reference in New Issue
Block a user