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

2 views
Skip to first unread message

Christian Brabandt

unread,
Apr 15, 2026, 2:15:16 PM (2 days ago) Apr 15
to vim...@googlegroups.com
patch 9.2.0354: filetype: not all Bitbake include files are recognized

Commit: https://github.com/vim/vim/commit/0e02be191909df88a8d6ef0a1b091c67c49b1888
Author: Martin Schwan <m.sc...@phytec.de>
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 <m.sc...@phytec.de>
Signed-off-by: Christian Brabandt <c...@256bit.org>

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 <Br...@vim.org>

# 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,
/**/
Reply all
Reply to author
Forward
0 new messages