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

Commit: 
https://github.com/vim/vim/commit/0e02be191909df88a8d6ef0a1b091c67c49b1888
Author: Martin Schwan <[email protected]>
Date:   Wed Apr 15 18:08:32 2026 +0000

    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: #19983
    
    Signed-off-by: Martin Schwan <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index b1c209400..f0330c205 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -3,7 +3,7 @@ vim9script
 # Vim functions for file type detection
 #
 # Maintainer:          The Vim Project <https://github.com/vim/vim>
-# Last Change:         2026 Apr 03
+# Last Change:         2026 Apr 15
 # Former Maintainer:   Bram Moolenaar <[email protected]>
 
 # These functions are moved here from runtime/filetype.vim to make startup
@@ -915,7 +915,7 @@ export def FTinc()
       elseif line =~ '^\s*\%({\|(\*\)' || line =~? ft_pascal_keywords
         setf pascal
         return
-      elseif line =~# '\<\%(require\|inherit\)\>' || line =~# 
'[A-Z][A-Za-z0-9_:${}/]*\s\+\%(??\|[?:+.]\)\?=.\? '
+      elseif line =~# '\<\%(require\|inherit\)\>' || line =~# 
'[A-Z][A-Za-z0-9_:${}/]*\(\[[A-Za-z0-9_:/]\+\]\)*\s\+\%(??\|[?:+.]\)\?=.\? '
         setf bitbake
         return
       endif
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 70e269ee6..892cd3238 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -2853,6 +2853,16 @@ func Test_inc_file()
   call assert_equal('bitbake', &filetype)
   bwipe!
 
+  call writefile(['FOO_BAR[baz] = "foobar"'], 'Xfile.inc')
+  split Xfile.inc
+  call assert_equal('bitbake', &filetype)
+  bwipe!
+
+  call writefile(['FOO_BAR_foo/bar[baz/bazzer] = "foobar"'], 'Xfile.inc')
+  split Xfile.inc
+  call assert_equal('bitbake', &filetype)
+  bwipe!
+
   call writefile(['MACHINEOVERRIDES =. "qemuall:"'], 'Xfile.inc')
   split Xfile.inc
   call assert_equal('bitbake', &filetype)
diff --git a/src/version.c b/src/version.c
index 2f48f475e..513632bd8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    354,
 /**/
     353,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wD4lV-004PHU-89%40256bit.org.

Raspunde prin e-mail lui