Skip to contentSkip to conversation

contrib: vim: Update file detection regex

PATCH New Joshua Watt 1 participant 1 message Oct 15, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 contrib/vim/ftdetect/bitbake.vim | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
contrib/vim/ftdetect/bitbake.vim +4 -4
index 427ab5b9..1d958fec 100644
@@ -14,12 +14,12 @@ endif
 au BufNewFile,BufRead *.{bb,bbappend,bbclass}  setfiletype bitbake
 
 " .inc -- meanwhile included upstream
-if !has("patch-9.0.0055")
+if !has("patch-9.1.1732")
     au BufNewFile,BufRead *.inc                call s:BBIncDetect()
     def s:BBIncDetect()
-        l:lines = getline(1) .. getline(2) .. getline(3)
-        if l:lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}]*\s\+\%(??\|[?:+]\)\?= '
-            set filetype bitbake
+        var lines = getline(1) .. getline(2) .. getline(3)
+        if lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}/]*\s\+\%(??\|[?:+.]\)\?=.\? '
+            set filetype=bitbake
         endif
     enddef
 endif
Signature · 1 line
2.51.0