summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2025-10-15 14:51:16 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-03 17:43:31 +0000
commit249793af751127ee28be2565974944fd42ae1789 (patch)
tree8a2f0f1cc2c0dbd52b9ee316061b3791bec31822 /bitbake
parent20c60e5ae3de9825c9b9c5e56109896e6a28e378 (diff)
downloadpoky-249793af751127ee28be2565974944fd42ae1789.tar.gz
bitbake: contrib: vim: Update file detection regex
The regex used to detect bitbake files was improved in patch 9.1.1732. Update the plugin to match that logic and fix a bug where the wrong expression was used to set the file type (Bitbake rev: 7ce0c9b44968f80a6060f9f9ff2cc00823b772cc) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/contrib/vim/ftdetect/bitbake.vim8
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/contrib/vim/ftdetect/bitbake.vim b/bitbake/contrib/vim/ftdetect/bitbake.vim
index 427ab5b987..1d958fec54 100644
--- a/bitbake/contrib/vim/ftdetect/bitbake.vim
+++ b/bitbake/contrib/vim/ftdetect/bitbake.vim
@@ -14,12 +14,12 @@ endif
14au BufNewFile,BufRead *.{bb,bbappend,bbclass} setfiletype bitbake 14au BufNewFile,BufRead *.{bb,bbappend,bbclass} setfiletype bitbake
15 15
16" .inc -- meanwhile included upstream 16" .inc -- meanwhile included upstream
17if !has("patch-9.0.0055") 17if !has("patch-9.1.1732")
18 au BufNewFile,BufRead *.inc call s:BBIncDetect() 18 au BufNewFile,BufRead *.inc call s:BBIncDetect()
19 def s:BBIncDetect() 19 def s:BBIncDetect()
20 l:lines = getline(1) .. getline(2) .. getline(3) 20 var lines = getline(1) .. getline(2) .. getline(3)
21 if l:lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}]*\s\+\%(??\|[?:+]\)\?= ' 21 if lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}/]*\s\+\%(??\|[?:+.]\)\?=.\? '
22 set filetype bitbake 22 set filetype=bitbake
23 endif 23 endif
24 enddef 24 enddef
25endif 25endif